CommandLine

Differences between revisions 3 and 4
Revision 3 as of 2005-12-02 09:14:58
Size: 3366
Editor: c211-31-5-226
Comment:
Revision 4 as of 2006-01-18 00:05:25
Size: 5408
Editor: ppp-70-251-243-233
Comment: Reoganised, hopefully now remove from CategoryCleanup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Adding repositories through command line ==
Sometime we might have to add repositories through the command line when X, the graphical interface, stops to working properly. This article aims to help adding/changing repositories through the console.
By default, Ubuntu does not enable the Universe and Multiverse repositories, nor the Backports. There may also be non-Ubuntu sources that you might wish to add to your Ubuntu machine, though this is generally not recommended. Repositories can be added using graphical means by following the guide at [AddingRepositoriesHowto]. It may be of value to learn this method as it works uniformly across all versions of ubuntu.
Line 4: Line 3:
If we want to add the universe repository, we would follow the procedure outlined below. The requirements are the ability to use a terminal based text editor like [https://wiki.ubuntu.com/NanoHowto nano]. If you are more comfortable using another editor, you can use it instead of nano.
Line 6: Line 5:
Type = Adding repositories through command line =
||<tablestyle="float:right; font-size: 0.9em; width:40%; background:#F1F1ED; margin: 0 0 1em 1em;" style="padding:0.5em;">'''Contents'''[[BR]][[TableOfContents(3)]]||

== Background information ==
The repositories are stored in a file '''/etc/apt/sources.list'''. By editing this file, we can add/remove repositories. The contents of the sources.list may be viewd by typing:
Line 10: Line 13:
'''Note:''' It's always a good idea to backup your sources.list before you edit it.
{{{
sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak
}}}
Line 11: Line 18:
nano is an easy editor to use with help along the bottom two lines. If you are more comfortable using another editor it does not matter. ''' Contents of the default sources.list (with line numbers)'''
Line 13: Line 20:
''' Contents of sources.list before editing'''
Line 15: Line 21:
deb-src http://us.archive.ubuntu.com/ubuntu breezy main restricted

## M
ajor 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
1 deb http://us.archive.ubuntu.com/ubuntu breezy main restricted
2
deb-src http://us.archive.ubuntu.com/ubuntu breezy main restricted
3
4 ## Uncomment the following two lines to fetch m
ajor bug fix updates produced
5 ## after the final release of the distribution.
6
deb http://us.archive.ubuntu.com/ubuntu breezy-updates main restricted
7 deb-src http://us.archive.ubuntu.com/ubuntu breezy-updates main restricted
8
9
## Uncomment the following two lines to add software from the 'universe'
10 ## repository.
11
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
12 ## team, and may not be under a free licence. Please satisfy yourself as to
13 ## your rights to use the software. Also, please note that software in
14 ## universe WILL NOT receive any review or updates from the Ubuntu security
15 ## team.
16 #
deb http://us.archive.ubuntu.com/ubuntu breezy universe multiverse
17 #
deb-src http://us.archive.ubuntu.com/ubuntu breezy universe multiverse
18
19 ## Uncomment the following two lines to add software from the 'backports'
20 ## repository.
21 ## N.B. software from this repository may not have been tested as
22 ## extensively as that contained in the main release, although it includes
23 ## newer versions of some applications which may provide useful features.
24 ## Also, please note that software in backports WILL NOT receive any review
25 ## or updates from the Ubuntu security team.
26 #
deb http://us.archive.ubuntu.com/ubuntu breezy-backports main restricted universe
     multiverse
27 #
deb-src http://us.archive.ubuntu.com/ubuntu breezy-backports main restricted universe
     multiverse
28 #
deb http://security.ubuntu.com/ubuntu breezy-security main restricted
30 #
deb-src http://security.ubuntu.com/ubuntu breezy-security main restricted
Line 39: Line 54:
After uncommenting the sources for the universe repository, we would have something similiar to this. == Adding Universe and Multiverse ==
The universe and multiverse repositories may be enabled by uncommenting (deleting the '#' at the beginning of the line) the sources for those repos. In this case, it would be line 16 (this might be different on your system). If you wish to enable only the Universe repository, delete the word 'multiverse' from line 16. If you wish to retrieve source packages, also uncomment line 17. After editing, the line should appear as shown below.
Line 41: Line 57:
''' Contents of sources.list after editing'''
Line 43: Line 58:
deb-src http://us.archive.ubuntu.com/ubuntu breezy main restricted 16 deb http://us.archive.ubuntu.com/ubuntu breezy universe multiverse
17
deb-src http://us.archive.ubuntu.com/ubuntu breezy universe multiverse
}}}
Line 45: Line 62:
## 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.
Save the file by doing ''ctrl + X'' and retrieve the updated package lists from the newly added repositories by issuing the command below in a terminal.
Line 72: Line 67:
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. Now, your system is ready to install packages from the universe and multiverse repository. Other repositories can be added to this file, but it is not recommended as it might break your system.
Line 74: Line 69:
CategoryDocumentation CategoryCleanup == Adding Outside Repositories ==
Sometimes other users will make repositories for packages they have.

'''Note:''' Some outside packages could break your Ubuntu installation. It may also be illegal to install a few packages, so please be careful while doing this.

Normally you find websites providing information about a repository in a form like the following example:
{{{
deb http://www.grawert.net/ubuntu/ breezy universe
}}}
Just copy the line at the end of your '''sources.list''', and then save the file. Then, retrieve updated packages from the repository by issuing the command below in the terminal.

{{{
sudo apt-get update
}}}

== Summary ==
 * Always back up your ''sources.list'' before editing
 * It is not recommended to enable other repositories as they may break your system. Be careful when you do this.
 * Please keep in mind that it may be illegal for you to enable some repositories.
 * If your sources.list becomes unusable, you can generate a custom sources.list at http://ubuntulinux.nl/source-o-matic
 * After editing the sources.list, remember to retrieve updated package lists by issuing a '''sudo apt-get update'''.
----
CategoryCleanup CategoryDocumentation

By default, Ubuntu does not enable the Universe and Multiverse repositories, nor the Backports. There may also be non-Ubuntu sources that you might wish to add to your Ubuntu machine, though this is generally not recommended. Repositories can be added using graphical means by following the guide at [AddingRepositoriesHowto]. It may be of value to learn this method as it works uniformly across all versions of ubuntu.

The requirements are the ability to use a terminal based text editor like [https://wiki.ubuntu.com/NanoHowto nano]. If you are more comfortable using another editor, you can use it instead of nano.

Adding repositories through command line

Background information

The repositories are stored in a file /etc/apt/sources.list. By editing this file, we can add/remove repositories. The contents of the sources.list may be viewd by typing:

sudo nano /etc/apt/sources.list

Note: It's always a good idea to backup your sources.list before you edit it.

sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak

Contents of the default sources.list (with line numbers)

1  deb http://us.archive.ubuntu.com/ubuntu breezy main restricted
2  deb-src http://us.archive.ubuntu.com/ubuntu breezy main restricted
3 
4  ## Uncomment the following two lines to fetch major bug fix updates produced
5  ## after the final release of the distribution.
6  deb http://us.archive.ubuntu.com/ubuntu breezy-updates main restricted
7  deb-src http://us.archive.ubuntu.com/ubuntu breezy-updates main restricted
8 
9  ## Uncomment the following two lines to add software from the 'universe'
10 ## repository.
11 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
12 ## team, and may not be under a free licence. Please satisfy yourself as to
13 ## your rights to use the software. Also, please note that software in
14 ## universe WILL NOT receive any review or updates from the Ubuntu security
15 ## team.
16 # deb http://us.archive.ubuntu.com/ubuntu breezy universe multiverse
17 # deb-src http://us.archive.ubuntu.com/ubuntu breezy universe multiverse
18 
19 ## Uncomment the following two lines to add software from the 'backports'
20 ## repository.
21 ## N.B. software from this repository may not have been tested as
22 ## extensively as that contained in the main release, although it includes
23 ## newer versions of some applications which may provide useful features.
24 ## Also, please note that software in backports WILL NOT receive any review
25 ## or updates from the Ubuntu security team.
26 # deb http://us.archive.ubuntu.com/ubuntu breezy-backports main restricted universe
     multiverse
27 # deb-src http://us.archive.ubuntu.com/ubuntu breezy-backports main restricted universe 
     multiverse 
28 # deb http://security.ubuntu.com/ubuntu breezy-security main restricted
30 # deb-src http://security.ubuntu.com/ubuntu breezy-security main restricted

Adding Universe and Multiverse

The universe and multiverse repositories may be enabled by uncommenting (deleting the '#' at the beginning of the line) the sources for those repos. In this case, it would be line 16 (this might be different on your system). If you wish to enable only the Universe repository, delete the word 'multiverse' from line 16. If you wish to retrieve source packages, also uncomment line 17. After editing, the line should appear as shown below.

16  deb http://us.archive.ubuntu.com/ubuntu breezy universe multiverse
17  deb-src http://us.archive.ubuntu.com/ubuntu breezy universe multiverse

Save the file by doing ctrl + X and retrieve the updated package lists from the newly added repositories by issuing the command below in a terminal.

sudo apt-get update

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

Adding Outside Repositories

Sometimes other users will make repositories for packages they have.

Note: Some outside packages could break your Ubuntu installation. It may also be illegal to install a few packages, so please be careful while doing this.

Normally you find websites providing information about a repository in a form like the following example:

deb http://www.grawert.net/ubuntu/ breezy universe

Just copy the line at the end of your sources.list, and then save the file. Then, retrieve updated packages from the repository by issuing the command below in the terminal.

sudo apt-get update

Summary

  • Always back up your sources.list before editing

  • It is not recommended to enable other repositories as they may break your system. Be careful when you do this.
  • Please keep in mind that it may be illegal for you to enable some repositories.
  • If your sources.list becomes unusable, you can generate a custom sources.list at http://ubuntulinux.nl/source-o-matic

  • After editing the sources.list, remember to retrieve updated package lists by issuing a sudo apt-get update.


CategoryCleanup CategoryDocumentation

Repositories/CommandLine (last edited 2008-08-06 16:38:21 by localhost)