Zero Install

Dr Thomas Leonard [ contact | GPG public key | blog | donations ]

Installation

Warning: This is the old version of Zero Install. You probably want to install the new injector version instead!

Although the system makes installing other software very easy, the Zero Install system itself still requires some work to install. You'll also need to have a few other things installed first (expat to parse the XML index files, wget to download archives, tar, bzip2 and gzip to extract them, GPG to check they are correctly signed, and D-BUS to report progress to graphical utilities). Most systems will have these installed already, although you may be missing the header files for expat (expat-dev). Note that, while you need libdbus installed, you don't need any DBUS daemons running (we only use the library part).

Security and stability note

This software is still under development and has not yet been carefully audited. Please do not run it on public machines (eg, in a school) where malicious users could exploit bugs in it. Please let me know if you find any problems.

Packages

If you don't want to build from source, choose your platform from the list below to get a package tailored for your system...

Distributions that have Zero Install running by default:

  • b00t Linux (minimal system running Zero Install by default)
Don't want to install a kernel module? You might like to try the Zero Install Injector. This project achieves similar goals to the filesystem implementation below, but is written in pure Python and doesn't even need root access to install.

Building from source

The Zero Install system requires a small Linux kernel module to provide the /uri/0install directory. Like all kernel modules, you must compile this using the actual kernel headers for the kernel you're actually running.

One way to ensure this is to have compiled your own kernel (eg, from kernel.org) and be running that. There are plenty of guides on the net if you don't feel confident about compiling your own kernel. For example, The Very Verbose Guide to Updating and Compiling Your Debian Kernel (which isn't very Debian specific, despite the name) and Compiling the Linux Kernel. When you install a kernel yourself, the headers get installed automatically at the same time.

If you're using a kernel provided with your distribution, you should find there is a package with the matching kernel headers supplied with the distribution, which you can install now. Use the uname -a command to find out which kernel version you are using. For example, on a Debian system, you could check the version and install the headers like this (things you type are shown in bold):

# uname -a
Linux everest 2.4.25 #1 [...] i386 GNU/Linux
# apt-get install kernel-headers-2.4.25-1-386

Supported kernels are:

  • Linux 2.4 series
  • Linux 2.6 series

If you want to port the (small) module to other kernels (BSD, MacOS X, etc) please get in touch.

We want to make the installation as easy as possible, so if you get stuck, please write to us or file a bug report.

Installing the LazyFS kernel module

Download the kernel module for your operating system:

Check the GPG signature, unpack the archive, and move to the new directory (things you type are shown in bold):

$ gpg lazyfs-linux-0.1.26.tgz.gpg
gpg: Signature made Mon 03 Jan 2005 15:01:28 GMT using DSA key ID 59A53CC1
gpg: Can't check signature: public key not found
$ tar xzf lazyfs-linux-0.1.26.tgz
$ cd lazyfs-linux-0.1.26

If you have my GPG key (see page header) in your keyring, the first step will tell you whether the archive is correctly signed. If not, you'll get the message shown above, but you can still continue anyway. The reason for using GPG here is partly to increase security, and partly to make sure you've got GPG installed (you'll need it later!).

Now, configure, make and install (use su to get root privileges):

$ ./configure
$ make
$ su -c 'make install'
*** Testing kernel module ***

If you've got Python and sudo installed, now would be a good time to run the unit-tests. This is optional, but it makes it easier for us to diagnose bugs if they're detected here (save your work first!):

$ python tests/check.py
lazyfs0d1d23: Device or resource busy
test1CacheLink (__main__.Test1WithoutHelper) ... ok
test2UnconnectedEmpty (__main__.Test1WithoutHelper) ... ok
test01Nothing (__main__.Test2WithHelper) ... ok
test02ReleaseHelper (__main__.Test2WithHelper) ... ok
[...]
test19BadRead (__main__.Test2WithHelper) ... ok
test20FMapping (__main__.Test2WithHelper) ... ok
test21Fstat (__main__.Test2WithHelper) ... ok

----------------------------------------------------------------------
Ran 23 tests in 3.424s

OK

If any of the tests fail or (even more exciting!) your system hangs, please report it! Reliable crashes in the unit tests should be easy to track down and fix. Note that if your kernel crashes, it might be better to run the tests from a text console. You're more likely to get diagnostics printed there than from within X.

Installing Zero Install

Once you've got LazyFS installed (see above), you can install Zero Install. Download latest version:

Check the GPG signature and unpack as before:

$ gpg zero-install-0.1.27.tar.gz.gpg
$ tar xzf zero-install-0.1.27.tar.gz
$ cd zero-install-0.1.27

For security reasons, zero-install does not run as root. So you'll now need to create a new user for it (eg, using the adduser command, or with a tool such as SuSE's YaST). Run configure with the name of your chosen user (here called 'zeroinst'):

$ ./configure --with-user=zeroinst
$ make
$ su -c 'make install'

This will create the /uri/0install mount point and the /var/cache/zero-inst cache directory. It will also add an entry to /etc/fstab to allow mounting /uri/0install easily. If you were already running an older version, this step also unmounts /uri/0install.

Now, run zero install (it will just wait, without doing anything). You can look at /var/log/daemon.log (or whatever your system uses) to see what it's doing. SuSE uses /var/log/messages instead.

$ su -c '/etc/init.d/0install start'
Starting zero-install...
(mounting /uri/0install)
zero-install: libdbus 0.20 or 0.21 detected.
$ tail /var/log/daemon.log
Aug 22 15:35:55 everest zero-install: Started: using cache directory '/var/cache/zero-inst'
Aug 22 15:35:55 everest zero-install: Network errors are logged to
                                      '/var/cache/zero-inst/.0inst-wget.log'
Aug 22 15:35:55 everest zero-install: libdbus 0.20 or 0.21 detected.

As with lazyfs, users with python and sudo may run the unit-tests now. As the tests check that the digital signature stuff works, you'll be prompted to create a GPG key for a test site.

$ python tests/0test.py
Logging to logfile 'log'
test01Nothing (__main__.TestSimple) ... ok
test02Fail (__main__.TestSimple) ... ok
test03EmptySite (__main__.TestSimple) ... ok
test04ReadFile (__main__.TestSimple) ... ok
test05InvalidSites (__main__.TestSimple) ... ok
test06ValidSites (__main__.TestSimple) ... ok

----------------------------------------------------------------------
Ran 6 tests in 3.362s

OK

Testing the installation

With zero install still running, try the following command:

$ cat /uri/0install/zero-install.sourceforge.net/demo/test.txt
It worked!

Users can see what they are currently downloading with the ZeroProgress utility, itself available via Zero Install:

$ /uri/0install/zero-install.sourceforge.net/apps/ZeroProgress/AppRun &
Starting ZeroProgress...
Ready and waiting...
Note that ZeroProgress requires the dbus-glib library, which is supplied as part of libdbus. If you're using Debian packages, you need to install the dbus-glib-1 package.

No windows appear on the screen when you run this, but any further downloads will display a progress box. Note that the GTK library is not yet in Zero Install, so you need to have that installed by traditional methods. In the same apps directory as ZeroProgress, you will also find 'ShowLog', which will display Zero Install's download log in case you get any errors.

You can open the ROX-Filer window shown on the main page using these commands (which also fetch the filer itself through Zero Install):

$ alias rox=/uri/0install/rox.sourceforge.net/rox
$ rox /uri/0install/rox.sourceforge.net/apps

This window will then appear (see the ROX Wiki page for more details):

The apps directory

Links to other sites with more software, including Mozilla, Python, Acrobat reader, pkg-config, GTK, Java and NEdit, can be found in the directory /uri/0install/zero-install.sourceforge.net/links, and on the wiki page Zero Install Sites.

Notes

  • I/O errors indicate that zero install failed to fetch the requested file. ZeroProgress should pop up a box with an explanation, if it's running. Otherwise, check the log file (as shown above).
  • When you reboot, /uri/0install is automatically mounted, but the zero-install helper program is not run automatically. Therefore, you will get I/O errors when trying to access anything new, until you do /etc/init.d/0install start.
  • Starting Zero Install automatically at boot time

Further reading

Please see the documentation for more information.