Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

After specifying the url of the repository, what do the tags like 'stable','non-free' mean in the entries of /etc/apt/sources.list ? If we know the url of a repository, how do we decide about these additional attributes while adding an entry in /etc/apt/sources.list ?

share|improve this question

3 Answers 3

Section 2.1 of the following page (reproduced below for ease of use) is what you want.

2.1 The /etc/apt/sources.list file 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:

 deb http://host/debian distribution section1 section2 section3
 deb-src http://host/debian distribution section1 section2 section3

Of course, the above entries are fictitious and should not be used. The first word on each line, deb or deb-src, indicates the type of archive: whether it contains binary packages (deb), that is, the pre-compiled packages that we normally use, or source packages (deb-src), which are the original program sources plus the Debian control file (.dsc) and the diff.gz containing the changes needed for `debianizing' the program.

We usually find the following in the default Debian sources.list:

 # See sources.list(5) for more information, especially
 # Remember that you can only use http, ftp or file URIs
 # CDROMs are managed through the apt-cdrom tool.
 deb http://http.us.debian.org/debian stable main contrib non-free
 deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free
 deb http://security.debian.org stable/updates main contrib non-free

 # Uncomment if you want the apt-get source function to work
 #deb-src http://http.us.debian.org/debian stable main contrib non-free
 #deb-src http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free

These are the lines needed by a basic Debian install. The first deb line points to the official archive, the second to the non-US archive and the third to the archive of Debian security updates.

The two last lines are commented out (with a `#' in front), so apt-get will ignore them. These are deb-src lines, that is, they point to Debian source packages. If you often download program sources for testing or recompiling, uncomment them.

The /etc/apt/sources.list file can contain several types of lines. APT knows how to deal with archives of types http, ftp, file (local files, e.g., a directory containing a mounted ISO9660 filesystem) and ssh, that I know of.

Do not forget to run apt-get update after modifying the /etc/apt/sources.list file. You must do this to let APT obtain the package lists from the sources you specified.

share|improve this answer

Each repository can decide how they wish to structure their packages.

Some provide "standard" naming, such as stable, unstable and non-free, but each can differ - adding sarge, potato and more.

One such provider can be seen on Opera's site, here. As you browse the directory strcuture, you can see how the deb directives match with the actual URL being used.

share|improve this answer

If you know the URL of a repository you can lookup the dists sub-directory to find out all the distributions that are available in that repository. If you enter those directories you can find out a Release file that lists the available sections in a Component field.

Example with the official Debian repository: http://ftp.debian.org/debian/

The distributions available can be seen at: http://ftp.debian.org/debian/dists/

If you take the lenny distributione you can grab the Release file here: http://ftp.debian.org/debian/dists/lenny/Release

Inside that file you can find the list of sections:

Components: main contrib non-free

And like people have already explained, in /etc/apt/sources.lists you have lines in the following format:

deb repository-url distribution section1 section2 section3

Now you can explore any well-maintained Debian repository !

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.