Dec. 19, 2009, 2:57 a.m.
posted by void
Modify the List of Package Repositories
Add extra Ubuntu software repositories to your system to gain access to thousands of new pieces of packaged software. If you are used to installing programs on operating systems other than Linux, the idea of package managers and repositories might seem a bit foreign. To install a program on Windows or Mac OS X, you would insert a CD or download an installer from the Internet and run it. Under Ubuntu, software comes in packages. Packages are the different groups of files that make up a particular piece of software, along with the instructions Ubuntu needs to install and remove the software, dependency information, and so on. With packages, Ubuntu lets you install and update all of your software using a single tool. Whether you use Synaptic [Hack #55], Adept [Hack #56], or apt-get [Hack #54], your package manager will automatically download and install packages you specify along with any other packages (dependencies) they might require. Instead of being randomly scattered on project pages around the Internet, Ubuntu packages reside in software repositories, which are centralized sites that contain a large number of packages. Each software repository contains a certain class of software that is generally intended for a particular release of Ubuntu, usually in both source and binary form (these are divided into their own repositories) and then further subdivided by what sort of support or software license the package has. Here are some of the main package repositories available for Ubuntu:
These repositories are further subdivided into categories based on what level of support a package has and, in some cases, what sorts of licenses or restrictions the software has. If you, for instance, want only software that is fully supported by Ubuntu, you can ensure that by choosing only the main subcategory. Here are the primary subcategories:
Add and Remove RepositoriesThere are a few different ways to change the repositories you subscribe to, based on what tools you use for package management. "Manage Packages with Synaptic" [Hack #55] and "Manage Packages with Adept" [Hack #56] cover managing package repositories with those tools. Still, all of these package managers reference the same /etc/apt/sources.list file. Here is a sample sources.list file for Dapper that illustrates the syntax: # dapper deb http://archive.ubuntu.com/ubuntu/ dapper main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ dapper main restricted # dapper-updates deb http://us.archive.ubuntu.com/ubuntu/ dapper-updates main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ dapper-updates main restricted # dapper-security deb http://security.ubuntu.com/ubuntu dapper-security main restricted deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted Knowing how Ubuntu separates repositories into categories, you can see how the syntax of these lines works. The first section of a line specifies whether Ubuntu is going to pull binary packages (deb) or source packages (deb-src) for a particular repository. The next section of the line contains the URL for the particular repository, which is usually either HTTP or FTP. Next, the particular repository is listed (in this example, dapper, dapper-updates, or dapper-security). Finally, you see a space-delimited list of subcategories to pull from. By default, Ubuntu will use main and restricted subcategories, but to add new subcategories, just add their names at the end of a particular line. So, for instance, to add universe and multiverse to the Dapper repository for both binary and source packages, change: deb http://archive.ubuntu.com/ubuntu/ dapper main restricted deb-src http://archive.ubuntu.com/ubuntu/ dapper main restricted to: deb http://archive.ubuntu.com/ubuntu/ dapper main restricted universe Once you save your changes, you will need to update your package list to use the new repositories either via apt-get update or through the Synaptic or Adept interface. To add new subcategories to other repositories, simply make the appropriate changes to their repository entries. Unofficial RepositoriesThere are a number of other unofficial package repositories on the Internet that you can also use with Ubuntu. Often these repositories provide a small subset of special packages that Ubuntu doesn't package by default, or perhaps provide a newer version of a package. These repositories generally will tell you the particular line to add to your sources.list, but be sure that the repository is designed to work with your particular Ubuntu release, or you may face compatibility conflicts between dependencies in the third-party repository and Ubuntu's native packages. |
- Comment