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@17 | 22 | Thanks to Piotr Roszatycki, the maintainer of fakechroot, for helpfully fixing
|
paul@17 | 23 | system call coverage in that utility in order to support cross-distribution
|
paul@17 | 24 | bootstrapping.
|
paul@17 | 25 |
|
paul@6 | 26 | Dependencies
|
paul@6 | 27 | ------------
|
paul@6 | 28 |
|
paul@6 | 29 | fakeroot Tested with 1.5.10ubuntu2
|
paul@17 | 30 | fakechroot 2.8 or later required
|
paul@15 | 31 | debootstrap Tested with 0.3.3.2ubuntu3 on Ubuntu Hoary 5.04, 1.0.7~feisty1
|
paul@15 | 32 | on Ubuntu Hoary 7.04
|
paul@6 | 33 |
|
paul@14 | 34 | New in userinstall 0.1.1 (Changes since userinstall 0.1)
|
paul@14 | 35 | --------------------------------------------------------
|
paul@14 | 36 |
|
paul@14 | 37 | * Fixed an argument parsing error in the user-setup script.
|
paul@14 | 38 |
|
paul@6 | 39 | Configuration
|
paul@6 | 40 | -------------
|
paul@6 | 41 |
|
paul@12 | 42 | If the system defaults are not to be used, or if userinstall is not installed
|
paul@6 | 43 | as a system package, the userinstall-defaults file supplied with the
|
paul@12 | 44 | distribution may be edited to specify the nature and location of the personal
|
paul@12 | 45 | package manager. The following settings can be edited:
|
paul@6 | 46 |
|
paul@6 | 47 | DISTNAME This should reflect the distribution being used and need only
|
paul@15 | 48 | be altered in special situations. Note that the setup process
|
paul@15 | 49 | may not work with different distributions due to library
|
paul@15 | 50 | incompatibilities.
|
paul@15 | 51 |
|
paul@12 | 52 | PACKAGEROOT The location of the personal package manager in the
|
paul@12 | 53 | filesystem.
|
paul@6 | 54 |
|
paul@6 | 55 | If a completely new userinstall-defaults file is created, it is essential that
|
paul@6 | 56 | the above variables be defined so that the scripts know where to create or to
|
paul@12 | 57 | find the personal package manager.
|
paul@6 | 58 |
|
paul@12 | 59 | Creating a Personal Package Manager
|
paul@12 | 60 | -----------------------------------
|
paul@6 | 61 |
|
paul@6 | 62 | In order to install packages as a non-root user, first invoke the user-setup
|
paul@6 | 63 | script; this will create and initialise a basic Debian system with a basic set
|
paul@6 | 64 | of packages installed. For example, with userinstall installed as a system
|
paul@12 | 65 | package, using the system defaults:
|
paul@6 | 66 |
|
paul@6 | 67 | user-setup
|
paul@6 | 68 |
|
paul@12 | 69 | Or with defaults in the current directory:
|
paul@6 | 70 |
|
paul@6 | 71 | ./user-setup
|
paul@6 | 72 |
|
paul@12 | 73 | It is possible to override the "template" for the system by specifying a
|
paul@6 | 74 | "mirror" location. This is useful if you have the CD or DVD image for the
|
paul@12 | 75 | distribution already mounted in the filesystem. For example:
|
paul@6 | 76 |
|
paul@6 | 77 | user-setup file:///cdrom
|
paul@20 | 78 |
|
paul@20 | 79 | sudo mount -o loop /home/me/downloads/kubuntu-7.04-alternate-i386.iso /tmp/cdrom
|
paul@20 | 80 | user-setup file:///tmp/cdrom
|
paul@6 | 81 |
|
paul@12 | 82 | An URI must be specified as the "mirror" location, not a normal filename.
|
paul@6 | 83 |
|
paul@12 | 84 | Adding Package Repositories to the Package Manager
|
paul@12 | 85 | --------------------------------------------------
|
paul@12 | 86 |
|
paul@12 | 87 | To get access to repositories of packages beyond those provided by the basic
|
paul@12 | 88 | distribution, edit the /etc/apt/sources.list file inside the system. The
|
paul@6 | 89 | user-path script can help you find the exact location of the file:
|
paul@6 | 90 |
|
paul@7 | 91 | user-path /etc/apt/sources.list
|
paul@6 | 92 |
|
paul@12 | 93 | Or with defaults in the current directory:
|
paul@6 | 94 |
|
paul@7 | 95 | ./user-path /etc/apt/sources.list
|
paul@6 | 96 |
|
paul@6 | 97 | And you can edit the file directly with a text editor (such as vi) as follows:
|
paul@6 | 98 |
|
paul@7 | 99 | vi `user-path /etc/apt/sources.list`
|
paul@6 | 100 |
|
paul@12 | 101 | Or with defaults in the current directory:
|
paul@6 | 102 |
|
paul@7 | 103 | vi `./user-path /etc/apt/sources.list`
|
paul@6 | 104 |
|
paul@6 | 105 | Installing Packages
|
paul@6 | 106 | -------------------
|
paul@6 | 107 |
|
paul@6 | 108 | To install packages from other repositories, invoke the user-apt-get script
|
paul@6 | 109 | with the options expected by the regular apt-get program. For example:
|
paul@6 | 110 |
|
paul@6 | 111 | user-apt-get --help
|
paul@6 | 112 | user-apt-get update
|
paul@15 | 113 |
|
paul@15 | 114 | It may be necessary to install the gnupg package to enable package signature
|
paul@15 | 115 | verification:
|
paul@15 | 116 |
|
paul@15 | 117 | user-apt-get install gnupg
|
paul@15 | 118 |
|
paul@15 | 119 | Then, other packages can be installed. For example:
|
paul@15 | 120 |
|
paul@6 | 121 | user-apt-get install python-cmdsyntax
|
paul@6 | 122 |
|
paul@6 | 123 | Provided that the specified packages are known and their dependencies can be
|
paul@12 | 124 | met, they will be installed into the system.
|
paul@6 | 125 |
|
paul@6 | 126 | Installing Single Packages
|
paul@6 | 127 | --------------------------
|
paul@6 | 128 |
|
paul@6 | 129 | To install individual package files, invoke the user-dpkg-i script with the
|
paul@6 | 130 | name of the package file. For example:
|
paul@6 | 131 |
|
paul@6 | 132 | user-dpkg-i /home/me/downloads/python-cmdsyntax_0.91-0ubuntu2_all.deb
|
paul@6 | 133 |
|
paul@12 | 134 | This script will copy the file into the personal package management
|
paul@12 | 135 | environment and run dpkg with the -i (install) option.
|
paul@7 | 136 |
|
paul@7 | 137 | Using Packages
|
paul@7 | 138 | --------------
|
paul@7 | 139 |
|
paul@7 | 140 | Unlike most packages installed in the usual way by the root user, the installed
|
paul@7 | 141 | packages will not reside within a directory hierarchy rooted at / - the top of
|
paul@7 | 142 | the filesystem. Instead, they will reside in a location such as the following:
|
paul@7 | 143 |
|
paul@7 | 144 | /home/me/.userinstall
|
paul@7 | 145 | /tmp/packages
|
paul@7 | 146 |
|
paul@7 | 147 | (The precise location may be found by running the user-path script.)
|
paul@7 | 148 |
|
paul@7 | 149 | Consequently, to make use of the installed software, it may be necessary to
|
paul@7 | 150 | edit your environment in a number of ways so that it may be located and
|
paul@7 | 151 | correctly loaded, initialised and executed.
|
paul@7 | 152 |
|
paul@7 | 153 | Using Python Packages
|
paul@7 | 154 | ---------------------
|
paul@7 | 155 |
|
paul@7 | 156 | Installed Python packages may be made available to Python by defining the
|
paul@7 | 157 | PYTHONPATH to include the directories usually searched by Python, but which
|
paul@12 | 158 | are actually located within the personal package management environment. For
|
paul@12 | 159 | example, with the Python 2.5 site-packages directory:
|
paul@7 | 160 |
|
paul@11 | 161 | PYTHONPATH=`user-path /usr/lib/python2.5/site-packages/` python2.5
|
paul@11 | 162 |
|
paul@11 | 163 | More complicated extension modules may require further adjustments to the
|
paul@11 | 164 | LD_LIBRARY_PATH and PYTHONPATH variables:
|
paul@11 | 165 |
|
paul@11 | 166 | export LD_LIBRARY_PATH=`./user-path /usr/lib`
|
paul@11 | 167 | export PYTHONPATH=`./user-path /usr/lib/python2.5/site-packages/`
|
paul@11 | 168 | export PYTHONPATH=${PYTHONPATH}:`./user-path /var/lib/python-support/python2.5`
|