Ubuntu Repository Configuration file: sources.list and sources.list.d

Repository configuration is managed by APT using configuration files in the /etc/apt directory. The /etc/apt/sources.list file holds repository entries. The main and restricted sections are enabled by default. An entry consists of a single line with the following format:

format URI release section

The format is normally deb, for Debian package format. The URI (universal resource identifier) provides the location of the repository, such as an FTP or Web URL. The release name is the official name of a particular Ubuntu distribution like maverick or jaunty. Ubuntu 10.10 has the name maverick. The section can be one or more terms that identify a section in that release’s repository. There can be more than one term used to specify a section, like main and restricted to specify the restricted section in the Ubuntu repository. The Multiverse and Universe sections can be specified by single terms: universe and multiverse. You can also list individual packages if you want. The entry for the Maverick restricted section is shown here.

deb http://us.archive.ubuntu.com/ubuntu/ maverick main restricted

Corresponding source code repositories will use a deb-src format.

deb-src http://us.archive.ubuntu.com/ubuntu/ maverick main restricted

Update repository for a section are referenced by the -updates suffix, as in maverick-updates.

deb http://archive.ubuntu.com/ubuntu/ maverick-updates main restricted

Security repository for a section is referenced with the suffix -security, as maverick-security.

deb http://archive.ubuntu.com/ubuntu/ maverick-security main restricted

Both Universe and Multiverse repositories should already be enabled. Each will have an updates repository as well as corresponding source code repositories, like those shown here for Universe.

deb http://us.archive.ubuntu.com/ubuntu/ maverick universe
deb-src http://us.archive.ubuntu.com/ubuntu/ maverick universe
deb http://us.archive.ubuntu.com/ubuntu/ maverick-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ maverick-updates universe

Comments begin with a # mark. You can add comments of your own if you wish. Commenting an entry effectively disables that component of a repository. Placing a # mark before a repository entry will effectively disable it.

Commented entries are included for the backports and Canonical partners repositories. Backports holds applications being developed for future Ubuntu releases and may not work well. Partners include companies like Adobe, VMware, and Parallels.

Most entries, including third-party entries for Ubuntu partners, can be managed using Software Sources. The backports entry requires that you edit the sources.list file. You can edit the file directly with the following command.

gksu gedit /etc/apt/sources.list

Then remove the # at the beginning of the line.

# deb http://us.archive.ubuntu.com/ubuntu/ maverick-backports main restricteduniverse multiverse

Repository information does not have to be added to the sources.list file directly. It can also be placed in a text file in the /etc/apt/sources.list.d directory, which APT will read as if part of the sources.list file. For example, to add the Medibuntu.org repository, a file is created in the /etc/at/sources.list.d directory, which contains the Medibuntu.org repository URL lines. This way you do not have to edit the /etc/apt/sources.list. Editing such an important file always includes the risk of incorrectly changing the entries.

Leave a Reply

Your email address will not be published. Required fields are marked *


2 * = sixteen

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>