About 0install

Zero Install is a decentralised cross-platform software
installation system available under the LGPL. It allows software
developers to publish programs directly from their own web-sites,
while supporting features familiar from centralised distribution
repositories such as shared libraries, automatic updates and digital
signatures. It is intended to complement, rather than replace, the
operating system's package management. 0install packages never
interfere with those provided by the distribution.

0install does not define a new packaging format; unmodified tarballs
or zip archives can be used. Instead, it defines an XML metadata
format to describe these packages and the dependencies between them. A
single metadata file can be used on multiple platforms (e.g. Ubuntu,
Debian, Fedora, openSUSE, Mac OS X and Windows), assuming binary or
source archives are available that work on those systems.

0install also has some interesting features not often found in
traditional package managers. For example, while it will share
libraries whenever possible, it can always install multiple versions
of a package in parallel when there are conflicting requirements.
Installation is always side-effect-free (each package is unpacked to
its own directory and will not touch shared directories such as
/usr/bin), making it ideal for use with sandboxing technologies and
virtualisation.

The XML file describing the program's requirements can also be
included in a source-code repository, allowing full dependency
handling for unreleased developer versions. For example, a user can
clone a Git repository and build and test the program, automatically
downloading newer versions of libraries where necessary, without
interfering with the versions of those libraries installed by their
distribution, which continue to be used for other software.

More than one thousand packages are currently available and you can easily
publish your own programs. Zero Install itself
is available from the official repositories of most Linux distributions
(including Debian, Fedora, Gentoo, Mint, openSUSE and Ubuntu) as well as
MacPorts.
See the Downloads page for details.

Overview of changes in 2.0

0install 2.0 brings many enhancements to the XML metadata syntax used to describe packages and their
dependencies, allowing a more precise specification of their requirements. Support for using distribution-provided
packages as dependencies was extended and now covers Arch Linux, Cygwin, Darwin, Debian, Fink, FreeBSD Ports, Gentoo, MacPorts, Mint, openSUSE, Red Hat, Slackware and Windows. The 0install software now supports apps, an easier way to manage 0install applications, improved diagnostics when no compatible versions can be selected, improved usability, and better support for use on headless servers.

The Ryppl project is using 0install as the package manager for a modular C++ build system, starting with a modularised C++ Boost library. This has driven many of the enhancements in 2.0, such as support compiling 0install packages on Windows. We hope that 0install will one day replace many of the language-specific packaging systems currently in use.

Extensions to the XML feed format

The 2.0 feed format is 100% backwards compatible with the 1.0 format (all software distributed for 1.0 will also work with 2.0). The new features are:

Optional dependencies

We try to select the best available version of the dependency, but it's OK if nothing can be selected (this is useful if a dependency isn't available on all platforms):

Some native packages only work with other packages from the same distribution. For example, MacPorts Python libraries only work with the MacPorts Python:

<restricts interface='...' distribution='MacPorts'>

The value can be any valid distribution name (e.g. 'RPM'), or '0install' to force a
0install implementation, not a package implementation.

More flexible version syntax

The new 'version' attribute provides a shorter and more flexible way to specify the compatible versions:

<requires interface='...' version='2.6..!3 | 3.2..'>

This allows any version from 2.6 up to (but excluding) 3, or version 3.2 or later.
However, the previous syntax using <version> should be used where possible, since it works with all versions of 0install.

Executable bindings

Two new bindings make it easy to depend on executable commands (not just on libraries). This is necessary on Windows, since it doesn't support #! lines, but it is also useful on other platforms. For example, if a program requires the "make" command in $PATH:

Obsolete interfaces can be flagged as such. Various tools will warn about the use of obsolete interfaces, and 0install knows that interfaces conflict with their replacements. For example, the "openjdk-6-jre" interface was replaced by the more general "openjdk-jre" (which covers versions 6 and 7):

The new sha256new algorithm is the same as sha256, except that the digest is encoded with base 32 rather than base 16 (for shorter strings), and the separator is '_' rather than '=', since '=' causes problems for some programs (e.g. cmake) if it appears in pathnames.

To avoid breaking older versions of 0install when adding new features,
any element in a feed can be tagged with a version expression, and only those
versions will look at it. For example, to add a requirement element that would
confuse current versions of 0install, you might one day write:

Support for new distributions: Arch, Cygwin, Darwin, Fink and MacPorts.

Changes to the 0install tool

App support

Apps are a new system to replace
0install 1.0's aliases. The main difference between apps and
aliases is that apps store their current selections (in
~/.config/0install.net/apps/NAME/selections.xml). This means that they
start faster, because the solver isn't needed. They also store historical
selections, making it easy to roll-back to a previous set of selected versions.
The commands are:

0install add NAME URI
0install run NAME
0install update NAME
0install show NAME
0install whatchanged NAME
0install destroy NAME

Specifying versions

The new range syntax can be used on the command line with the new
--version attribute, e.g.

As "!" is often a shell special character, remember to quote it when
specifying ranges.
The new --version-for option allows you to constrain the version of
dependencies too, not just the root. e.g. to force the use of Python
2.6 with Edit:

This replaces the old broken one. Instead of
telling you the first URL it would have fetched, which isn't helpful,
it actually does the downloads and shows the changes that it would
have made to the system (saving things in the cache, trusting GPG
keys, creating short-cuts, etc), as an educational aid.

Site-local packages

This makes things easier for 0compile: instead of putting builds in the cache
and registering them with the interface, 0compile can now just drop a build in
~/.local/share/0install.net/site-packages/URI/VERSION and 0install
will find it and add it automatically. The build can be removed by
simply deleting the directory.

0install digest

This replaces "0store manifest", but has a saner syntax.
It can also be used directly on an archive.

0install man

This is similar to the old '0alias --manpage', but also copes with app
launchers. So, to make man(1) work with 0install launchers, do:

alias man="0install man --"

0install update

This now notifies the user if there is a newer unselected version, and
suggests turning on help_with_testing if that might help.

Mirroring of archives

0install 1.0 can use a mirror service as a
fallback to get the XML feeds; 0install 2.0 can also use the mirror
to get missing archives.
Note however that our default public mirror server does not actually mirror any
archives by default.

Better headless use

We used to assume that a GUI was available whenever $DISPLAY was set. However,
there could be other reasons why the GUI can't be used, such as missing Python
modules, which we now cope with. There are new split Debian packages for
headless servers, to avoid pulling in any GUI dependencies.

Translations

There's a new German translation, and a Transifex project to support new translations.

Internals

Internally, 0install can now run with Python 2 or 3, with PyGTK or PyGObject, and with GTK 2 or GTK 3.

We batch up queries to PackageKit for better performance.

The GUI no longer slows to a crawl when showing download progress for a package with hundreds of dependencies.

We use threads, not processes, for downloads. This is slightly faster and
uses less memory. We also now limit the number of concurrent downloads from a
single site, as opening a large number of simultaneous connections causes
problems for some networks and servers.

Updates to related tools

0compile

0compile now works on Windows, not just POSIX systems. It gained support for <command name='compile'> to give the compile command, allowing the use of <runner>. It also now allows you to provide a template for the binary's XML.

0downstream

The new 0downstream tool makes it easy to generate feeds and keep them up to date based on an existing upstream project.

0env

The new 0env tool makes it easy to step into a shell session with a particular library available.