UPDATE: As it has been pointed out in the comments, all of the core repositories are enabled in Ubuntu 7.10. This post will only apply to users still on 6.10 and earlier.
It has been quite some time since I’ve outlined adding and customizing your repository setup on Ubuntu. I figure it’s time for a reminder post, and I’ll show you what I use on my machines.
In order to download and install Ubuntu packages your machine needs to know where to find them. These packages are stored in different locations called repositories, which are organized into a few main groups. The group definitions are as follows:
- main – supported by canonical, core repository.
- restricted – supported by canonical, containing non-free software.
- universe – community supported, strictly free software.
- multiverse – community supported, containing non-free software.
By default only main and restricted are activated on a new machine. In order to follow many of my tutorials you’ll need the other two activated. (I know I haven’t done a great job of specifying which repository is needed for which package, but I’ll try and improve.)
To activate these you can use the graphical method or the commad line method. Both are pretty easy, I’ll outline each below:
Graphical Repository Configuration
Navigate to “System > Admin > Software Sources” and you’ll be presented with five check-boxes. By default you may only see two of these checked. Check the additional two (universe and multiverse), and you can safely leave the fifth item, source code, unchecked.
Command Line Repository Configuration
The method above is dead-easy, but you may also be working on a server that doesn’t have a GUI installed. In this case you may want to edit the file under-the-hood manually. You can find this file in /etc/apt/sources.list. My file looks like:
deb http://us.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
Each line should begin with deb, so if the browser or wordpress wraps the lines above, it should come to three lines when you edit your file.
By default you’ll have a bunch of other lines, and a lot of commented options. I find that my config should be a safe bet for most users. Note: you also may want to change your repository location, as mine is pointing to the US servers.
It is also common to find suggestions on using third-party repositories for other software. I, and most other members of the support community, HIGHLY avoid this. It can cause problems with current packages, and can cause issues with upgrading. Adding a repository other than the official Ubuntu repositories can limit the level of support you can recieve.