paul@6 | 1 | Introduction
|
paul@6 | 2 | ------------
|
paul@6 | 3 |
|
paul@6 | 4 | The userinstall distribution consists of a number of scripts, together with a
|
paul@6 | 5 | short configuration file, which allows non-root users to set up and use their
|
paul@12 | 6 | own package and dependency management facilities and to download and install
|
paul@12 | 7 | Debian packages without having to obtain root privileges. The software within
|
paul@12 | 8 | installed packages may then be used, subject to certain constraints such as
|
paul@12 | 9 | program environments, library paths, and so on. In effect, userinstall
|
paul@12 | 10 | provides a personal package manager.
|
paul@6 | 11 |
|
paul@6 | 12 | Contact, Copyright and Licence Information
|
paul@6 | 13 | ------------------------------------------
|
paul@6 | 14 |
|
paul@6 | 15 | The current Web page for userinstall at the time of release is:
|
paul@6 | 16 |
|
paul@6 | 17 | http://www.boddie.org.uk/paul/userinstall.html
|
paul@6 | 18 |
|
paul@6 | 19 | Copyright and licence information can be found in the docs directory - see
|
paul@6 | 20 | docs/COPYING.txt and docs/gpl-3.0.txt for more information.
|
paul@6 | 21 |
|
paul@6 | 22 | Dependencies
|
paul@6 | 23 | ------------
|
paul@6 | 24 |
|
paul@6 | 25 | fakeroot Tested with 1.5.10ubuntu2
|
paul@6 | 26 | fakechroot Tested with 2.5-1.1
|
paul@6 | 27 | debootstrap Tested with 0.3.3.2ubuntu3
|
paul@6 | 28 |
|
paul@6 | 29 | Configuration
|
paul@6 | 30 | -------------
|
paul@6 | 31 |
|
paul@12 | 32 | If the system defaults are not to be used, or if userinstall is not installed
|
paul@6 | 33 | as a system package, the userinstall-defaults file supplied with the
|
paul@12 | 34 | distribution may be edited to specify the nature and location of the personal
|
paul@12 | 35 | package manager. The following settings can be edited:
|
paul@6 | 36 |
|
paul@6 | 37 | DISTNAME This should reflect the distribution being used and need only
|
paul@6 | 38 | be altered in special situations.
|
paul@12 | 39 | PACKAGEROOT The location of the personal package manager in the
|
paul@12 | 40 | filesystem.
|
paul@6 | 41 |
|
paul@6 | 42 | If a completely new userinstall-defaults file is created, it is essential that
|
paul@6 | 43 | the above variables be defined so that the scripts know where to create or to
|
paul@12 | 44 | find the personal package manager.
|
paul@6 | 45 |
|
paul@12 | 46 | Creating a Personal Package Manager
|
paul@12 | 47 | -----------------------------------
|
paul@6 | 48 |
|
paul@6 | 49 | In order to install packages as a non-root user, first invoke the user-setup
|
paul@6 | 50 | script; this will create and initialise a basic Debian system with a basic set
|
paul@6 | 51 | of packages installed. For example, with userinstall installed as a system
|
paul@12 | 52 | package, using the system defaults:
|
paul@6 | 53 |
|
paul@6 | 54 | user-setup
|
paul@6 | 55 |
|
paul@12 | 56 | Or with defaults in the current directory:
|
paul@6 | 57 |
|
paul@6 | 58 | ./user-setup
|
paul@6 | 59 |
|
paul@12 | 60 | It is possible to override the "template" for the system by specifying a
|
paul@6 | 61 | "mirror" location. This is useful if you have the CD or DVD image for the
|
paul@12 | 62 | distribution already mounted in the filesystem. For example:
|
paul@6 | 63 |
|
paul@6 | 64 | user-setup file:///cdrom
|
paul@6 | 65 | user-setup file:///home/me/downloads/kubuntu-7.04-alternate-i386.iso
|
paul@6 | 66 |
|
paul@12 | 67 | An URI must be specified as the "mirror" location, not a normal filename.
|
paul@6 | 68 |
|
paul@12 | 69 | Adding Package Repositories to the Package Manager
|
paul@12 | 70 | --------------------------------------------------
|
paul@12 | 71 |
|
paul@12 | 72 | To get access to repositories of packages beyond those provided by the basic
|
paul@12 | 73 | distribution, edit the /etc/apt/sources.list file inside the system. The
|
paul@6 | 74 | user-path script can help you find the exact location of the file:
|
paul@6 | 75 |
|
paul@7 | 76 | user-path /etc/apt/sources.list
|
paul@6 | 77 |
|
paul@12 | 78 | Or with defaults in the current directory:
|
paul@6 | 79 |
|
paul@7 | 80 | ./user-path /etc/apt/sources.list
|
paul@6 | 81 |
|
paul@6 | 82 | And you can edit the file directly with a text editor (such as vi) as follows:
|
paul@6 | 83 |
|
paul@7 | 84 | vi `user-path /etc/apt/sources.list`
|
paul@6 | 85 |
|
paul@12 | 86 | Or with defaults in the current directory:
|
paul@6 | 87 |
|
paul@7 | 88 | vi `./user-path /etc/apt/sources.list`
|
paul@6 | 89 |
|
paul@6 | 90 | Installing Packages
|
paul@6 | 91 | -------------------
|
paul@6 | 92 |
|
paul@6 | 93 | To install packages from other repositories, invoke the user-apt-get script
|
paul@6 | 94 | with the options expected by the regular apt-get program. For example:
|
paul@6 | 95 |
|
paul@6 | 96 | user-apt-get --help
|
paul@6 | 97 | user-apt-get update
|
paul@6 | 98 | user-apt-get install python-cmdsyntax
|
paul@6 | 99 |
|
paul@6 | 100 | Provided that the specified packages are known and their dependencies can be
|
paul@12 | 101 | met, they will be installed into the system.
|
paul@6 | 102 |
|
paul@6 | 103 | Installing Single Packages
|
paul@6 | 104 | --------------------------
|
paul@6 | 105 |
|
paul@6 | 106 | To install individual package files, invoke the user-dpkg-i script with the
|
paul@6 | 107 | name of the package file. For example:
|
paul@6 | 108 |
|
paul@6 | 109 | user-dpkg-i /home/me/downloads/python-cmdsyntax_0.91-0ubuntu2_all.deb
|
paul@6 | 110 |
|
paul@12 | 111 | This script will copy the file into the personal package management
|
paul@12 | 112 | environment and run dpkg with the -i (install) option.
|
paul@7 | 113 |
|
paul@7 | 114 | Using Packages
|
paul@7 | 115 | --------------
|
paul@7 | 116 |
|
paul@7 | 117 | Unlike most packages installed in the usual way by the root user, the installed
|
paul@7 | 118 | packages will not reside within a directory hierarchy rooted at / - the top of
|
paul@7 | 119 | the filesystem. Instead, they will reside in a location such as the following:
|
paul@7 | 120 |
|
paul@7 | 121 | /home/me/.userinstall
|
paul@7 | 122 | /tmp/packages
|
paul@7 | 123 |
|
paul@7 | 124 | (The precise location may be found by running the user-path script.)
|
paul@7 | 125 |
|
paul@7 | 126 | Consequently, to make use of the installed software, it may be necessary to
|
paul@7 | 127 | edit your environment in a number of ways so that it may be located and
|
paul@7 | 128 | correctly loaded, initialised and executed.
|
paul@7 | 129 |
|
paul@7 | 130 | Using Python Packages
|
paul@7 | 131 | ---------------------
|
paul@7 | 132 |
|
paul@7 | 133 | Installed Python packages may be made available to Python by defining the
|
paul@7 | 134 | PYTHONPATH to include the directories usually searched by Python, but which
|
paul@12 | 135 | are actually located within the personal package management environment. For
|
paul@12 | 136 | example, with the Python 2.5 site-packages directory:
|
paul@7 | 137 |
|
paul@11 | 138 | PYTHONPATH=`user-path /usr/lib/python2.5/site-packages/` python2.5
|
paul@11 | 139 |
|
paul@11 | 140 | More complicated extension modules may require further adjustments to the
|
paul@11 | 141 | LD_LIBRARY_PATH and PYTHONPATH variables:
|
paul@11 | 142 |
|
paul@11 | 143 | export LD_LIBRARY_PATH=`./user-path /usr/lib`
|
paul@11 | 144 | export PYTHONPATH=`./user-path /usr/lib/python2.5/site-packages/`
|
paul@11 | 145 | export PYTHONPATH=${PYTHONPATH}:`./user-path /var/lib/python-support/python2.5`
|