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 (cc = your country code)


e.g. deb gutsy main restricted universe multiverse </dd>

deb gutsy main restricted
deb-src gutsy main restricted

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

deb gutsy-updates main restricted
deb-src gutsy-updates main restricted


deb gutsy universe
deb-src gutsy universe
deb gutsy-updates universe
deb-src gutsy-updates universe

## Multiverse

deb gutsy multiverse
deb-src gutsy multiverse
deb gutsy-updates multiverse
deb-src gutsy-updates multiverse

## Backports

deb gutsy-backports main restricted universe multiverse
deb-src gutsy-backports main restricted universe multiverse

## Canonical Partner Repository 

deb gutsy partner
deb-src gutsy partner
deb gutsy-security main restricted
deb-src gutsy-security main restricted
deb gutsy-security universe
deb-src gutsy-security universe
deb gutsy-security multiverse
deb-src gutsy-security multiverse

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

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