This post is something that may be fairly basic for many of you, but extremely helpful for anyone new to using Ubuntu. In an attempt to be as comprehensive as I can with my tutorials I wanted to go back to the basics.
Ubuntu (and Debian) use a package management system called APT. This system uses a list of repositories to access updates and install programs specifically designed for your distribution and version. This system is generally more secure and more stable than other methods. Mainly for the reasons that access into these public repositories is kept very strict, and each package is thouroughly tested before it is included. Packages are also digitally signed for verification and security.
This tutorial will outline how to manually edit and update your repository source list to access whatever program you might need.
As usual, before editing any system file you will want to back it up. You should backup your sources.list file using the following command at a terminal:
sudo cp /etc/apt/sources.list /etc/apt/sources.list-backup
Below is an example of a sources list for Ubuntu including main, restricted, security, universe and multiverse. This will give you access to everything in the official Ubuntu repositories (over 20,000 packages)
# Ubuntu supported packages
deb http://archive.ubuntu.com/ubuntu edgy main restricted
deb http://archive.ubuntu.com/ubuntu edgy-updates main restricted
deb http://security.ubuntu.com/ubuntu edgy-security main restricted
# Ubuntu community supported packages
deb http://archive.ubuntu.com/ubuntu edgy universe multiverse
deb http://archive.ubuntu.com/ubuntu edgy-updates universe multiverse
deb http://security.ubuntu.com/ubuntu edgy-security universe multiverse
To update your current sources.list to this expanded list (by default the universe and multiverse are not activated) run the following command:
sudo gedit /etc/apt/sources.list
..and overwrite the contents of the existing file with the example above. Note: the example above does not include the “source” for these packages. Normal users generally don’t make use of the source for the packages. Unless you know you are going to be manually compiling and editing the source for the programs you don’t need to worry about it. If you do want the source simply add a duplicate line using the prefix deb-src instead of deb.
After you’ve made changes to your sources.list file you can update to the latest list using the command:
sudo aptitude update
At that point you can request any available updates using the command:
sudo aptitude upgrade
At this point the system will compare any current versions you have and install any upgrades that are available on the public repositories. Your system will automagically check for updates normally on a daily basis.
EDIT: To create a customized sources.list file based on your interests or needs you can visit the Source-O-Matic published by the Ubuntu Netherlands Team. (note: the source-o-matic currently only supports up to Dapper and NOT edgy.)
You may also be interested in my recent post, Seveas Repository.