Apt > sources.list
As part of its operation, Apt uses a file that lists the 'sources' from which packages can be obtained. This file is /etc/apt/sources.list.
The entries in this file normally follow this format (the entries below are fictitious and should not be used):
deb http://site.example.com/debian distribution component1 component2 component3 deb-src http://site.example.com/debian distribution component1 component2 component3
The first word on each line, deb or deb-src, indicates the type of archive. Deb indicates that the archive contains binary packages (deb), the pre-compiled packages that we normally use. Deb-src indicates source packages, which are the original program sources plus the Debian control file (.dsc) and the diff.gz containing the changes needed for packaging the program.
The 'distribution' can be either the release code name / alias (jessie, stretch, buster, sid) or the release class (oldstable, stable, testing, unstable) respectively. If you mean to be tracking a release class then use the class name, if you want to track a Debian point release, use the code name.
For example, if you have a system running Debian 9.3 "stretch" and don't want to upgrade when Debian buster releases, use 'stretch' instead of 'stable' for the distribution. If you always want to help test the testing release, use 'testing'. If you are tracking buster and want to stay with it from testing to end of life, use 'buster'.
contrib packages contain DFSG-compliant software, but have dependencies not in main (possibly packaged for Debian in non-free).
non-free contains software that does not comply with the DFSG.
Below is an example of a sources.list for Debian 9/Stretch.
deb http://deb.debian.org/debian stretch main deb-src http://deb.debian.org/debian stretch main deb http://deb.debian.org/debian stretch-updates main deb-src http://deb.debian.org/debian stretch-updates main deb http://security.debian.org/debian-security/ stretch/updates main deb-src http://security.debian.org/debian-security/ stretch/updates main
If you also want the contrib and non-free components, add contrib non-free after main:
deb http://deb.debian.org/debian stretch main contrib non-free deb-src http://deb.debian.org/debian stretch main contrib non-free deb http://deb.debian.org/debian stretch-updates main contrib non-free deb-src http://deb.debian.org/debian stretch-updates main contrib non-free deb http://security.debian.org/debian-security/ stretch/updates main contrib non-free deb-src http://security.debian.org/debian-security/ stretch/updates main contrib non-free
You can use a GNOME tool to edit your sources.list file. Access it through Menu → System → Administration → Software Sources.
gksu --desktop /usr/share/applications/software-properties.desktop /usr/bin/software-properties-gtk
If you'd rather use your CD-ROM for installing packages or updating your system automatically with APT, you can put it in your /etc/apt/sources.list. To do so, you can use the apt-cdrom program like this:
# apt-cdrom add
with the Debian CD-ROM in the drive.
You can use -d for the directory of the CD-ROM mount point or add a non-CD mount point (i.e. a USB keydrive).
On occasion name resolution can break. For example, below is from a S/390x Port running in a QEMU Chroot:
# apt-get update 0% [Working]Unsupported socketcall: 20 Unsupported socketcall: 20 Unsupported socketcall: 20 Unsupported socketcall: 20 Unsupported socketcall: 20 Unsupported socketcall: 20 Unsupported socketcall: 20 Unsupported socketcall: 20 Err:1 http://ftp.us.debian.org/debian testing InRelease Temporary failure resolving 'ftp.us.debian.org' Reading package lists... Done W: Failed to fetch http://ftp.us.debian.org/debian/dists/testing/InRelease Temporary failure resolving 'ftp.us.debian.org' W: Some index files failed to download. They have been ignored, or old ones used instead.
You can temporarily work around it by obtaining the IP address from another machine, and then using the IP address rather than the URI:
echo "deb http://22.214.171.124/debian testing main contrib" > /etc/apt/sources.list apt-get update Get:1 http://126.96.36.199/debian testing InRelease [232 kB] Get:2 http://188.8.131.52/debian testing/main s390x Packages [7583 kB] Get:3 http://184.108.40.206/debian testing/main Translation-en [5134 kB] Get:4 http://220.127.116.11/debian testing/contrib s390x Packages [42.7 kB] Get:5 http://18.104.22.168/debian testing/contrib Translation-en [44.7 kB] Fetched 13.0 MB in 32s (403 kB/s) Reading package lists... Done
sources.list(5) man page
A list of UnofficialRepositories to get extra software ( Skype, Opera, Google )
RepositoryInstructions - explains how to setup a secure third-party repository and tell users how to configure it