sources.list
aptitude
, apt-get
, and apt
Commandsapt-cache
aptitude
, 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.xz
or a variant using a different compression method (such as Packages.gz
or .bz2
) files (in case of a source of binary packages) and Sources.xz
or a variant (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 SUGGERIMENTO Aggiornamento incrementale).
/etc/apt/sources.list
contiene la descrizione di una sorgente, formata di 3 parti separate da spazi.
deb
» per i pacchetti binari,
deb-src
» per i pacchetti sorgente.
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.
./
» che indica l'assenza di una sottodirectory: i pacchetti sono allora direttamente all'URL specificato). Nella maggior parte dei casi comuni, però, i repository saranno strutturati come un mirror Debian, con più distribuzioni ciascuna con più componenti. In questi casi, indicare la distribuzione scelta (con il suo «nome in codice», per il quale vedere la lista nel riquadro COMUNITÀ Bruce Perens, leader controverso, oppure con la «suite» corrispondente: stable
, testing
, unstable
), poi le componenti (o sezioni) da abilitare (scelte in un mirror Debian tipico tra main
, contrib
e non-free
).
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 update
command). From then on, APT can require the disc to be inserted if it needs one of its packages.
sources.list
per un sistema che utilizza la versione Stable di Debian:
Esempio 6.1. File /etc/apt/sources.list
per gli utenti di Debian Stable
# Security updates deb http://security.debian.org/ jessie/updates main contrib non-free deb-src http://security.debian.org/ jessie/updates main contrib non-free ## Debian mirror # Base repository deb http://ftp.debian.org/debian jessie main contrib non-free deb-src http://ftp.debian.org/debian jessie main contrib non-free # Stable updates deb http://ftp.debian.org/debian jessie-updates main contrib non-free deb-src http://ftp.debian.org/debian jessie-updates main contrib non-free # Stable backports deb http://ftp.debian.org/debian jessie-backports main contrib non-free deb-src http://ftp.debian.org/debian jessie-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
. Per questa ragione, le sorgenti non ufficiali vengono solitamente aggiunte alla fine del file.
security.debian.org
(su un piccolo insieme di macchine mantenute dai Debian System Administrator). Questo archivio contiene aggiornamenti di sicurezza (preparati dal Team Debian per la sicurezza o dai manutentori dei pacchetti) per la distribuzione Stable.
proposed-updates
, accuratamente selezionato dai Stable Release Manager.
proposed-updates
è il luogo in cui gli aggiornamenti pianificati vengono preparati (sotto la supervisione dei Stable Release Manager).
jessie-proposed-updates
alias which is both more explicit and more consistent since wheezy-proposed-updates
also exists (for the Oldstable updates):
deb http://ftp.debian.org/debian jessie-proposed-updates main contrib non-free
stable-backports
ospita i «backport di pacchetti». Questa espressione si riferisce ad un pacchetto di un qualche software recente che è stato ricompilato per una distribuzione più vecchia, generalmente per Stable.
stable-backports
è ora disponibile sui consueti mirror Debian. I backport per Squeeze però sono ancora ospitati su un server dedicato backports.debian.org
) e richiedono la seguente voce in sources.list
:
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free
stable-backports
sono sempre creati dai pacchetti disponibili in Testing. Ciò assicura che tutti i backport installati siano aggiornabili alla corrispondente versione stabile, una volta che sia disponibile il successivo rilascio stabile di Debian.
$
sudo apt-get install package/jessie-backports
$
sudo apt-get install -t jessie-backports package
sources.list
standard per un sistema che utilizza la versione Testing o Unstable di Debian:
Esempio 6.2. File /etc/apt/sources.list
per gli utenti di 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 # Aggiornamenti di sicurezza 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
, APT installerà i pacchetti da Unstable. Se questo non è ciò che si desidera, usare l'impostazione APT::Default-Release
(vedere la Sezione 6.2.3, «Aggiornamento del sistema») per indicare ad APT di scegliere i pacchetti da un'altra distribuzione (molto probabilmente Testing in questo caso).
sources.list
di APT non porta all'uso sistematico dei suoi pacchetti. La riga da aggiungere è:
deb http://ftp.debian.org/debian experimental main contrib non-free
mentors.debian.net
site is interesting (although it only provides source packages), 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.
sources.list
di APT resta invariato, ma APT viene configurato in modo da usarli come proxy per le richieste in uscita.
/etc/approx/approx.conf
:
# <name> <repository-base-url> debian http://ftp.debian.org/debian security http://security.debian.org
inetd
») e richiede che gli utenti modifichino i propri file sources.list
in modo che puntino al server approx:
# Sample sources.list pointing to a local approx server deb http://apt.falcot.com:9999/security jessie/updates main contrib non-free deb http://apt.falcot.com:9999/debian jessie main contrib non-free