Выбрать главу

→ http://backports.debian.org/

The sources.list entry for backports targeting the Squeeze distribution is the following:

deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free

6.1.1.3. The Experimental Repository

The archive of Experimental packages is present on all Debian mirrors, and contains packages which are not in the Unstable version yet because of their substandard quality — they are often software development versions or pre-versions (alpha, beta, release candidate…). A package can also be sent there after undergoing subsequent changes which can generate problems. The maintainer then tries to uncover them thanks to advanced users who can manage important issues. After this first stage, the package is moved into Unstable, where it reaches a much larger audience and where it will be tested in much more detail.

Experimental is generally used by users who do not mind breaking their system and then repairing it. This distribution gives the possibility to import a package which a user wants to try or use as the need arises. That is exactly how Debian approaches it, since adding it in APT's sources.list file does not lead to the systematic use of its packages. The line to be added is:

deb http://ftp.debian.org/debian experimental main contrib non-free

6.1.2. Non-Official Resources: apt-get.org and mentors.debian.net

There are numerous non-official sources of Debian packages set up by advanced users who have recompiled some softwares, by programmers who make their creation available to all, and even by Debian developers who offer pre-versions of their package online. A web site was set up to find these alternative sources more easily. It contains an impressive amount of Debian package sources which can immediately be integrated into sources.list files. However, be careful not to add random packages. Each source is designed for a particular version of Debian (the one used to compile the packages in question); each user should maintain a certain coherence in what they choose to install.

→ http://www.apt-get.org/

The mentors.debian.net site is also interesting, since it gathers packages created by candidates to the status of official Debian developer or by volunteers who wish to create Debian packages without going through that process of integration. These packages are made available without any guarantee regarding their quality; make sure that you check their origin and integrity and then test them before you consider using them in production.

COMMUNITY The debian.net sites

The debian.net domain is not an official resource of the Debian project. Each Debian developer may use that domain name for their own use. These websites can contain unofficial services (sometimes personal sites) hosted on a machine which does not belong to the project and set up by Debian developers, or even prototypes about to be moved on to debian.org. Two reasons can explain why some of these prototypes remain on debian.net: either no one has made the necessary effort to transform it into an official service (hosted on the debian.org domain, and with a certain guarantee of maintenance), or the service is too controversial to be officialized.

Installing a package means giving root rights to its creator, because they decide on the contents of the initialization scripts which are run under that identity. Official Debian packages are created by volunteers who have been co-opted and reviewed and who can seal their packages so that their origin and integrity can be checked.

In general, be wary of a package whose origin you don't know and which isn't hosted on one of the official Debian servers: evaluate the degree to which you can trust the creator, and check the integrity of the package.

→ http://mentors.debian.net/

GOING FURTHER Old package versions: snapshot.debian.org

A new service (introduced in April 2010) can be used to “go backwards in time” and to find an old version of a package. It can be used for example to identify which version of a package introduced a regression, and more concretely, to come back to the former version while waiting for the regression fix.

6.2. aptitude and apt-get Commands

APT is a vast project, whose original plans included a graphical interface. It is based on a library which contains the core application, and apt-get is the first interface — command-line based — which was developed within the project.

Numerous other graphical interfaces then appeared as external projects: synaptic, aptitude (which includes both a text mode interface and a graphical one — even if not complete yet), wajig, etc. The most recommended interface, aptitude, is the one used during the installation of Debian. Since its command-line syntax is very similar to apt-get's, we will be focusing on aptitude in the examples given in this section. When there are major differences between aptitude and apt-get, these differences will be detailed.

6.2.1. Initialization

For any work with APT, the list of available packages needs to be updated; this can be done simply through aptitude update. Depending on the speed of your connection, the operation can take a while since it involves downloading a certain number of Packages.(gz|bz2) files (or even Sources.(gz|bz2)), which have gradually become bigger and bigger as Debian has developed (more than 8 MB for the largest Packages.gz — from the main section). Of course, installing from a CD-ROM set does not require any downloading — in this case, the operation is very fast.

6.2.2. Installing and Removing

With APT, packages can be added or removed from the system, respectively with aptitude install package and aptitude remove package. In both cases, APT will automatically install the necessary dependencies or delete the packages which depend on the package that is being removed. The aptitude purge package or apt-get purge package commands involve a complete uninstallation — the configuration files are also deleted.

TIP Installing the same selection of packages several times

It can be useful to systematically install the same list of packages on several computers. This can be done quite easily.

First, retrieve the list of packages installed on the computer which will serve as the “model” to copy.

dpkg --get-selections >pkg-list

The pkg-list file then contains the list of installed packages. Next, transfer the pkg-list file on the computers you want to update and use the following commands:

dpkg --set-selections <pkg-list

apt-get dselect-upgrade

The first command registers the list of packages you wish to install, then the apt-get invocation executes the required operations! aptitude does not have this command.

TIP Removing and installing at the same time

It is possible to ask aptitude (or apt-get) to install certain packages and remove others on the same command line by adding a suffix. With an aptitude install command, add “-” to the names of the packages you wish to remove. With an aptitude remove command, add “+” to the names of the packages you wish to install.