Thousands of software packages are stored in archives which are commonly referred to as repositories. Repositories make it very easy to install software packages provided you have Internet connection. It also provide high level security as each software package in archives are thoroughly tested and built specifically for each version of Ubuntu.
Software repositories are organized into 4 categories according to level of support provided by Ubuntu.
+ Main : oficially supported software by Ubuntu.
+ Restricted : software which are not available under completely free license.
+Universe : not officially supported software
+Multi verse : software which are not free.
Note : After installation two repository component are available viz Main, Restricted.
Repository can be edited(modified) by making some changes in /etc/apt/source.list file.
Managing Repository Through Command Line :
Since we know apt stores a list of repository or software channel in a file.
For modification in repository we have to make changes in /etc/apt/source.list.
Note : It is a good idea to make a backup of source.list before editing source.list.
sudo cp /etc/apt/source.list /etc/apt/source.list.backup
Now open source.list for editing -
gedit /etc/apt/source.list
Explanation of various contents of source.list :
deb http://us.archive.ubuntu.com/ubuntu hardy main restricted
deb-src http://us.archive.ubuntu.com/ubuntu hardy main restricted
1> All lines starting with # or ## are comments.
2>Lines without # are apt repository lines and are read by synaptic, apt-get etc.
Lines starting with:
2.1> deb : These repositories contains binary or pre compiled packages which are required by most of the users.
2.2> deb-src : These repositories contains the source code of packages which are useful for developers.
3> deb/deb-src is then followed by location of package on Internet like http://archieve.ubuntu.com/ubuntu i.e URI(Uniform Resource Identifier).
- In our case it is : ftp://ftp.iitb.ac.in/os/ubuntu/archives/
4> hardy : is the name or version of your distribution.
- For Ubuntu 10.04 it is : Lucid Lynx
5> Followed by repository component.
Adding Repository : Refer here
If we want to add Multi verse and universe repositories then we have to add lines with multi verse and universe. But remember to add lucid-update. So that we can get updated software pa
ckages list from multi verse and universe repositories.
sudo apt-get update : For updation of repositories.
NOTE: 1> In some ubuntu versions Launchpad ppa i.e adding repository through commandline works like ubuntu 9.10
ex: sudo add-apt-repository ppa:<repository-name>
2> Make sure repositories that u r adding should be compatible with your Ubuntu version, otherwise it may cause inconsistency to your system and may be u have to re install Ubuntu.
3> When u edit source.list then always update repository by sudo apt-get update.
4> always take backup when editing source.list