CommandLine

Revision 2 as of 2005-11-01 04:33:39

Clear message

Adding repositories through command line

Sometime we might have to add repositories through the command line when X fails to work. This article aims to help adding/changing repositories through the console.

If we want to add the universe repository, we would follow the procedure outlined below.

Type

sudo nano /etc/apt/sources.list

Contents of sources.list before editing

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

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu breezy-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu breezy-updates main restricted

## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
#deb http://archive.ubuntu.com/ubuntu/ breezy universe main restricted multiverse
#deb-src http://us.archive.ubuntu.com/ubuntu breezy universe

#deb http://security.ubuntu.com/ubuntu breezy-security main restricted
#deb-src http://security.ubuntu.com/ubuntu breezy-security main restricted

#deb http://security.ubuntu.com/ubuntu breezy-security universe
#deb-src http://security.ubuntu.com/ubuntu breezy-security universe

After uncommenting the sources for the universe repository, we would have something similiar to this.

Contents of sources.list after editing

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

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu breezy-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu breezy-updates main restricted

## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://archive.ubuntu.com/ubuntu/ breezy universe main restricted multiverse
deb-src http://us.archive.ubuntu.com/ubuntu breezy universe

deb http://security.ubuntu.com/ubuntu breezy-security main restricted
deb-src http://security.ubuntu.com/ubuntu breezy-security main restricted

deb http://security.ubuntu.com/ubuntu breezy-security universe
deb-src http://security.ubuntu.com/ubuntu breezy-security universe

Save the file by doing ctrl + X, then type the following in a terminal.

sudo apt-get update

Now, your system is ready to install packages from the universe repository. Other repositories can be added to this file, but it is not recommended as it might break your system.

CategoryDocumentation CategoryCleanup