Possibly one of the most useful features of Ubuntu Server is the apt-get command, it allows you to install software without having to compile or mess around with too many configuration files.Apt-Get installs software from a database maintained by Ubuntu, and then automatically configures most software.

It knows where to look from a list of “sources” stored in a configuration file, which has references to multiple locations of software sources.

If you wish to download software which isn’t available on one of the sources, or stop your computer from accessing a source you need to edit the sources.list file, located in.

/etc/apt/sources.list

Below are the stages which you need to go through to edit this file.

  1. Login, for this task you will require root privileges so follow the instructions set out in this previous post. I will be using the sudo command, since it is probably best practice to do so.
  2. You will need to edit the file using a basic text editor, an example of one is pico, which I will be using. This is a easy to use, and simple to learn editor. Type in the following command at the terminal:
  3. sudo nano /etc/apt/sources.list

  4. You will then be asked to enter your root password, once you have done so press [enter] and then you will be presented with a text editor similar to figure 1.
  5. Figure 1

  6. All of the lines with hashes (#) in front of them are commented out, so they will be ignored. The first reference to a source is on the third line, this tells the apt-get software to look on the installation CD-Rom to try to find the software you requested, although this can become a bit of a pain to put in a CD every time you want to install some software, so if you add a # before that line it will be ignored. You can also tell your computer to search in other places by removing the # from a line, below is a copy of sources.list with all repositories open, and all comments removed to make it smaller, you can use this simply by copying & pasting it into the sources.list file.

  7. deb http://gb.archive.ubuntu.com/ubuntu/ edgy main restricted
    deb-src http://gb.archive.ubuntu.com/ubuntu/ edgy main restricted
    deb http://gb.archive.ubuntu.com/ubuntu/ edgy-updates main restricted
    deb-src http://gb.archive.ubuntu.com/ubuntu/ edgy-updates main restricted
    deb http://gb.archive.ubuntu.com/ubuntu/ edgy universe
    deb-src http://gb.archive.ubuntu.com/ubuntu/ edgy universe
    deb http://gb.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse
    deb-src http://gb.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse
    deb http://security.ubuntu.com/ubuntu edgy-security main restricted
    deb-src http://security.ubuntu.com/ubuntu edgy-security main restricted
    deb http://security.ubuntu.com/ubuntu edgy-security universe
    deb-src http://security.ubuntu.com/ubuntu edgy-security universe

    Download Here

  8. Once you have finished editing sources.list you will need to save it, to do this press [Control]+[Alt]+[X] then follow the onscreen instructions.
  9. You will then need to update apt-get by entering the following command:
  10. sudo apt-get update