sources.list
Fileaptitude
and apt-get
Commandsapt-cache
Commandaptitude
, synaptic
/etc/apt/sources.list
will list the different repositories (or “sources”) that publish Debian packages. APT will then import the list of packages published by each of these sources. This operation is achieved by downloading Packages.{gz,bz2,lzma,xz}
files (in case of a source of binary packages) and Sources.{gz,bz2,lzma,xz}
(in case of a source of source packages) and by analyzing their contents. When an old copy of these files is already present, APT can update it by only downloading the differences (see sidebar TIP Incremental upgrade).
/etc/apt/sources.list
file contains the description of a source, made of 3 parts separated by spaces.
deb
” for binary packages,
deb-src
” for source packages.
Packages.gz
files, it must give a full and valid URL): this can consist in a Debian mirror or in any other package archive set up by a third party. The URL can start with file://
to indicate a local source installed in the system's file hierarchy, with http://
to indicate a source accessible from a web server, or with ftp://
for a source available on an FTP server. The URL can also start with cdrom://
for CD-ROM/DVD-ROM/Blu-ray disc based installations, although this is less frequent, since network-based installation methods are more and more common.
./
” which refers to the absence of a subdirectory — the packages are then directly at the specified URL). But in the most common case, the repositories will be structured like a Debian mirror, with multiple distributions each having multiple components. In those cases, name the chosen distribution (by its “codename” — see the list in sidebar COMMUNITY Bruce Perens, a controversial leader — or by the corresponding “suites” — stable
, testing
, unstable
), then the components (or sections) to enable (chosen between main
, contrib
, and non-free
in a typical Debian mirror).
cdrom
entries describe the CD/DVD-ROMs you have. Contrary to other entries, a CD-ROM is not always available since it has to be inserted into the drive and since only one disc can be read at a time. For those reasons, these sources are managed in a slightly different way, and need to be added with the apt-cdrom
program, usually executed with the add
parameter. The latter will then request the disc to be inserted in the drive and will browse its contents looking for Packages
files. It will use these files to update its database of available packages (this operation is usually done by the apt-get update
command). From then on, APT can require the disc to be inserted if it needs one of its packages.
sources.list
for a system running the Stable version of Debian:
Example 6.1. /etc/apt/sources.list
file for users of Debian Stable
# Security updates deb http://security.debian.org/ wheezy/updates main contrib non-free deb-src http://security.debian.org/ wheezy/updates main contrib non-free ## Debian mirror # Base repository deb http://ftp.debian.org/debian wheezy main contrib non-free deb-src http://ftp.debian.org/debian wheezy main contrib non-free # Stable updates deb http://ftp.debian.org/debian wheezy-updates main contrib non-free deb-src http://ftp.debian.org/debian wheezy-updates main contrib non-free # Stable backports deb http://ftp.debian.org/debian wheezy-backports main contrib non-free deb-src http://ftp.debian.org/debian wheezy-backports main contrib non-free
stable
, stable-updates
, stable-backports
) because we don't want to have the underlying distribution changed outside of our control when the next stable release comes out.
sources.list
file will be used. For this reason, non-official sources are usually added at the end of the file.
security.debian.org
(on a small set of machines maintained by the Debian System Administrators). This archive contains security updates (prepared by the Debian Security Team and/or by package maintainers) for the Stable distribution.
proposed-updates
repository, carefully selected by the Stable Release Managers.
proposed-updates
repository is where the expected updates are prepared (under the supervision of the Stable Release Managers).
wheezy-proposed-updates
alias which is both more explicit and more consistent since squeeze-proposed-updates
also exists (for the Oldstable updates):
deb http://ftp.debian.org/debian wheezy-proposed-updates main contrib non-free
stable-backports
repository hosts “package backports”. The term refers to a package of some recent software which has been recompiled for an older distribution, generally for Stable.
stable-backports
repository is now available on the usual Debian mirrors. But backports for Squeeze are still hosted on a dedicated server (backports.debian.org
), and requires the following sources.list
entry:
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free
stable-backports
are always created from packages available in Testing. This ensures that all installed backports will be upgradable to the corresponding stable version once the next stable release of Debian is available.
$sudo apt-get install package/wheezy-backports
$sudo apt-get install -t wheezy-backports package
sources.list
for a system running the Testing or Unstable version of Debian:
Example 6.2. /etc/apt/sources.list
file for users of Debian Testing/Unstable
# Unstable deb http://ftp.debian.org/debian unstable main contrib non-free deb-src http://ftp.debian.org/debian unstable main contrib non-free # Testing deb http://ftp.debian.org/debian testing main contrib non-free deb-src http://ftp.debian.org/debian testing main contrib non-free # Stable deb http://ftp.debian.org/debian stable main contrib non-free deb-src http://ftp.debian.org/debian stable main contrib non-free # Security updates deb http://security.debian.org/ stable/updates main contrib non-free deb http://security.debian.org/ testing/updates main contrib non-free deb-src http://security.debian.org/ stable/updates main contrib non-free deb-src http://security.debian.org/ testing/updates main contrib non-free
sources.list
file APT will install packages from Unstable. If that is not desired, use the APT::Default-Release
setting (see Section 6.2.3, “System Upgrade”) to instruct APT to pick packages from another distribution (most likely Testing in this case).
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
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.
mentors.debian.net
site is also interesting, since it gathers source 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.
sources.list
is left unchanged, but APT is configured to use them as proxy for outgoing requests.
/etc/approx/approx.conf
:
# <name> <repository-base-url> debian http://ftp.debian.org/debian security http://security.debian.org
inetd
Super-Server”) and requires the users to adjust their sources.list
file to point to the approx server:
# Sample sources.list pointing to a local approx server deb http://apt.falcot.com:9999/security wheezy/updates main contrib non-free deb http://apt.falcot.com:9999/debian wheezy main contrib non-free