APT - sources.list

APT - sources.list

Posted By: pmietlicki

Published to Linux on Jun 04, 2015

La liste des sources de paquets se trouve dans /etc/apt/sources.list, elle indique les différents emplacements disponibles des paquets Debian.

APT devra ensuite rapatrier la liste ainsi que l'en-tête de ces sources. Il réalise cette opération en téléchargeant les fichiers Packages.gz ou Packages.bz2 (cas d'une source de paquets binaires) et Sources.gz ou Sources.bz2 (Cas d'une source de paquets sources) en analysant leur contenu.


The list of package sources is in /etc/apt/sources.list, it shows the different locations available for Debian packages.

APT will then retrieve the list and the header of these sources. It accomplishes this by downloading the Packages.gz files or Packages.bz2 (case of a source of binary packages) and Sources.gz or Sources.bz2 (Case of a source of source packages) by analyzing their contents.

The sources.list file contains on each line a source description that is divided into three parts separated by spaces:

The first field indicates the type of source:

"deb" for binary packages
"deb-src" for source packages

The second field indicates the base URL.

This is a debian mirror or other package archive set up by third parties. The URL can start with file:// to indicate a local source in the file tree, http:// to indicate an accessible source from a web server, or ftp:// to a source available on a FTP server.

The last field has a variable syntax depending on whether the source is a Debian mirror or not.

In the case of a Debian mirror, the chosen distribution (stable packages containing proven and safe for servers packages, testing containing proven packages of ten days of the unstable: it is a good compromise between a system up to date and secure, unstable: to test developing packages: if you want to invest in the Debian project, indicating the various bugs, use this distribution) then the different desired sections (main, contrib, non-free).

Example: a sources.list stable distribution (to be replaced by testing or unstable according to the desired distribution):

# Security update
deb http://security.debian.org/ stable/updates main contrib non-free 
# Debian mirror 
http://ftp.fr.debian.org/debian stable main contrib non-free 
deb-src http://ftp.fr.debian.org/debian stable main contrib non-free

Tags: APT, sources.list

Archive