How to add extra repositories

From Cosmin's Wiki

Jump to: navigation, search

Home > Linux how to's > How to add extra repositories


Manual Method for Adding Repositories

From what I have seen, the default installation comes with pretty good repositories. However, should you decide to add others, here's how you can do it:

Create a backup of your current list of sources.

sudo cp -p /etc/apt/sources.list /etc/apt/sources.list_backup
  • Open the list of sources in a text editor

Ubuntu users:

sudo gedit /etc/apt/sources.list
  • Replace everything with the following lines

To use your local mirror you can add "cc." before archive.ubuntu.com (cc = your country code)

</dd>

e.g. deb http://lv.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse </dd>

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

## Major bug fix updates produced after the final release of the
## distribution.

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

##Universe

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

## Multiverse

deb http://us.archive.ubuntu.com/ubuntu/ gutsy multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy multiverse
deb http://us.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse

## Backports

deb http://us.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse

## Canonical Partner Repository 

deb http://archive.canonical.com/ubuntu gutsy partner
deb-src http://archive.canonical.com/ubuntu gutsy partner
deb http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb-src http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb http://security.ubuntu.com/ubuntu gutsy-security universe
deb-src http://security.ubuntu.com/ubuntu gutsy-security universe
deb http://security.ubuntu.com/ubuntu gutsy-security multiverse
deb-src http://security.ubuntu.com/ubuntu gutsy-security multiverse

## PLF REPOSITORY (Unsupported.  May contain illegal packages.  Use at own risk.)
deb http://packages.medibuntu.org/ gutsy free non-free

  • Save the edited file
wget -q <a href="http://packages.medibuntu.org/medibuntu-key.gpg" class="external free" title="http://packages.medibuntu.org/medibuntu-key.gpg" rel="nofollow">http://packages.medibuntu.org/medibuntu-key.gpg</a> -O- | sudo apt-key add -
sudo apt-get update