ADS

Sunday, 3 July 2011

How To Add repositories in Ubuntu via Command Line

Tags: Linux, Ubuntu, Add repositories, Command Line.

Method 2: Via Command Line and file source.list.

1. Ubuntu uses apt for package management. Apt stores a list of repositories or software channels in the file, so It's always a good idea to backup a configuration file like sources.list before you edit it. To do so, issue the following command:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

2. Use your editor and open this file:
sudo gedit /etc/apt/sources.list

3. You can add custom software repositories by adding the apt repository line of your software source to the list of repositories. It should look something like this:
deb http://mirror3.ubuntulinux.nl/ hardy-seveas freenx
Just add this line at the end of file source.list and save this file.

4. Run update command:
sudo apt-get update

Method 3: Via Command Line Only (Add Lauchpad PPA)

1. This method can apply only from Ubuntu 9.10, Karmic Koala or higher. And first of all, You must install python-software-properties first
sudo apt-get install python-software-properties

2. Now if you want to add an repository just run the following line:
sudo add-apt-repository ppa:<repository-name>

Note: The repository-name can be found in the software that you want to install pages.

No comments:

Post a Comment