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