个人工具

UbuntuHelp:Repositories/Ubuntu

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月13日 (日) 23:29的版本

跳转至: 导航, 搜索



Anchor(what)

What are Repositories?

There are thousands of programs available to install on Ubuntu. These programs are stored in software archives (repositories) and are available for installation over the Internet. This makes it very easy to install new programs. It is also very secure, because each program you install is thoroughly tested and built specifically for Ubuntu.

The Ubuntu software repository is organised into four "components", on the basis of the level of support Ubuntu can offer them, and whether or not they comply with Ubuntu's Free Software Philosophy. The components are called Main (officially supported software), Restricted (supported software that is not available under a completely free license), Universe (community-maintained, i.e. not officially supported software) and Multiverse (software that is "not free"). You can find more information about the Ubuntu Repositories here.

The Ubuntu Install CDs contain software from the Main and Restricted components. Once your system is made aware of the Internet-based locations for these repositories, many more software programs are made available for installation. Using the software package management tools already installed on your system, you can search for, install and update any piece of software directly over the Internet, without the need for the CD.



Adding Repositories in Ubuntu

IconsPage?action=AttachFile&do=get&target=eyes.png This page describes how to manage software repositories in Ubuntu 6.10 (Edgy Eft) and Ubuntu 6.06 (Dapper Drake). For Kubuntu please see Kubuntu repository management. For earlier versions of UbuntuIconsPage?action=AttachFile&do=get&target=terminal.png this wiki page]].

https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=terminal.png+The+operations+described+on+this+page+modify+the+software+repositories+configuration+file+located+at+

/etc/apt/sources.list 
Software sources can also be managed by making direct modifications to this file using the command line. If you prefer to use the command line instead of a graphical user interface, see [[UbuntuHelp:../CommandLine| Managing Repositories from the Command Line]] instead.



Adding the Universe and Multiverse Repositories


  • Navigate to "System" > "Administration" > "Software Properties". You will have to enter your password here.

Ubuntu?action=AttachFile&do=get&target=menu-sw.png

attachment:activating-repos.png
  • Click Close to save your changes. A dialog box should appear, askinhttps://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=info.png the list of repositorieshttps://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=info.png+%27%27%27Integration+with+Synaptic+Package+Manager%27%27%27nfo.png Integration with Synaptic Package Manager

Ubuntu?action=AttachFile&do=get&target=reload.png use the Synaptic package manager, click ohttps://help.ubuntu.com/community/Repositories/Ubuntu?action=AttachFile&do=get&target=synaptic-repos.pngmake it aware of the new software repositories.

attachment:reload.png


  • You can also manahttps://help.ubuntu.com/community/Repositories/Ubuntu?action=AttachFile&do=get&target=RepositoriesUbuntu01.pngn Synaptic by shttps://help.ubuntu.com/community/Repositories/Ubuntu?action=AttachFile&do=get&target=RepositoriesUbuntu02.png".
attachment:synaptic-repos.png


Adding Canonical Commercial Repositories

To launchhttps://help.ubuntu.com/community/Repositories/Ubuntu?action=AttachFile&do=get&target=RepositoriesUbuntu03.png'System -> Administration -> Synaptic Package Manager .

attachttps://help.ubuntu.com/community/Repositories/Ubuntu?action=AttachFile&do=get&target=RepositoriesUbuntu04.pngext you wihttps://help.ubuntu.com/community/Repositories/Ubuntu?action=AttachFile&do=get&target=RepositoriesUbuntu05.png be able to launch Synaptic as super user.

attachment:RepositoriesUbuntu02.png

Once that's all done you should nowhttps://help.ubuntu.com/community/Repositories/Ubuntu?action=AttachFile&do=get&target=RepositoriesUbuntu06.pngon your screen. On the menu of this screen you will want to click on Settings -> Repositories

attachment:RepositoriesUbuntu03.png

This is were you will be able to add the Canonical commercial repositories. on the left of the screen click on the button Add.

attachment:RepositoriesUbuntu04.png

The Add Channel screen will come up. On this screen select the Custom option.

attachment:RepositoriesUbuntu05.png

On this screen type the following line and then click on Add Channel.

deb http://archive.canonical.com/ubuntu feisty-commercial main

attachment:RepositoriesUbuntu06.png

Now hit Close. From the main Synaptic window, hit Reload. Once this finishes, you will now be able to IconsPage?action=AttachFile&do=get&target=warning.png ommercial https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=warning.png+%27%27%27Note%3A%27%27%27+There+are+some+%28but+not+many%29+good+reasons+for+which+you+might+want+to+add+non-Ubuntu+repositories+to+your+list+of+software+sources.+For+example%2C+some+software+cannot+be+distributed+by+Ubuntu+due+to+patent+and+licensing+restrictions+in+some+countries+%28see+the+RestrictedFormats+page+for+examples%29.+You+might+want+to+add+repositories+that+offer+such+software.+Make+sure+that+%27%27%27all%27%27%27+repositories+you+add+in+this+way+have+been+tested+and+are+known+to+work+on+Ubuntu+systems.+Repositories+that+are+not+designed+to+work+with+your+version+of+Ubuntu+can+introduce+inconsistencies+in+your+system+and+might+force+you+to+re-install.signed to work with your version of Ubuntu can introduce inconsistencies in your system and might force you to re-install.



Anchor(add) You can add custom software repositories by adding the apt repository line of your software source to the list of repositories. To do so, click on the Add button next to the Channel list in the Software Preferences panel, then select Custom.

 attachhttps://help.ubuntu.com/community/IconsPage?action=AttachFile&https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=info.png+For+an+explanation+of+the+different+parts+of+the+apt+line%2C+see+the+%5B%5Bedit+Editing+Repositories%5D%5D+section+below.+tp://mirror3.ubuntulinux.nl/ dapper-seveas freenx </nowiki></pre>


Ubuntu?action=AttachFile&do=get&target=IconsPage%2Finfo.png For an explanation of the different parts of the apt line, see the edit Editing Repositories section below.



Managing Local Repositories

Disable the CD-ROM Repository

If you have installed Ubuntu from one of Ubuntu's CD-ROMs, the CD will be included in the list of repositories used by the package managment tools. When you install a new package, Synaptic will check whether the package is available locally (i.e. on the CD-ROM). Synaptic may then ask for the CD-ROM. This can help reduce the size of downloads and speed up the installation process. If you would like Synaptic to rely solely on the internet repositories for package management, you can disable the CD-ROM entry with a few steps:

  • Launch Synaptic and navigate to "Settings" > "Repositories".
    A list of software repositories or "Channels" will be shown.
  • Locate the entry for the CD-ROM (it may say something like CD disk with Ubuntu 6.06 LTS). Click on the checkbox next to it to disable the CD-ROM as a software source.
  • Click the Close button to save the changes you have made.
  • You can re-enable the CD-ROM at any time using the checkbox next to itshttps://help.ubuntu.com/community/IconsPage?action=Ahttps://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=eyes.png+Use+with+caution%3A+At+present%2C+you+will+not+be+asked+to+confirm+the+remove+action.+This+is+not+a+problem+with+the+Ubuntu+repositories+as+you+can+simply+%5B%5Badd+add+them+again%5D%5D%2C+but+you+may+have+to+look+up+ahttps://help.ubuntu.com/community/Repositories/Ubuntu?action=AttachFile&do=get&target=edit-channel.pngyou+mistakenly+delete+it.+%28It+is+always+a+good+idea+to+back+up+your+sources.list%29will not be asked to confirm the remove action. This is not a problem with the Uhttps://help.ubuntu.com/community/Repositories/Ubuntu?action=AttachFile&do=get&target=IconsPage%2Feyes.png+The+corresponding+apt+line+has+%27%27%27deb%27%27%27+for+binary+repositories+and+%27%27%27deb-src%27%27%27+for+source+code+repositories. (It is always a good idea to back up your sources.list)



Anchor(edit)

Editing Repositories

To make changes to a sofhttps://help.ubuntu.com/community/https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=eyes.png+The+corresponding+apt+line+has+%27%27%27deb%27%27%27+for+binary+repositories+and+%27%27%27deb-src%27%27%27+for+source+code+repositories.ts components.

attachment:edit-channel.png


  • Type Software sources may contain software in binary or sourchttps://help.ubuntu.com/community/Repositories/Ubuntu?action=AttachFile&do=get&target=IconsPage%2Feyes.png ption that corresponds to the repository.
attachment:IconsPage/eyes.png The corresponding apt line has deb for binary repositories and deb-src for source code repositories.


  • URI Enter a valid Uniform Resource Indicator or URI for the software repository. Here's a list of examples:


      • cdrom
cdrom:[description_of_cd]/
      • ftp
ftp://ftp.domain.ext/path/to/repository
      • http
http://www.domain.ext/path/to/repository file://path/to/local/directory


  • Distribution
    Select the name of the distribuhttps://hehttps://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=info.png+Repositories+defined+using+the+%27%27%27Software+Preferences%27%27%27+panel+are+available+to+%27%27%27Update-Manager%27%27%27+and+will+be+periodically+checked+for+updates.
    Select the repository section to access. Add more sections separated by spaces.
    (The [[apthttps://help.ubuntu.com/community/Repositories/Ubuntu?action=AttachFile&do=get&target=IconsPage%2Finfo.png a freenx section.)


  • Comment
    Add a comment to describe the repository for easier reference.


attachment:IconsPage/info.png Repositories defined using the Software Preferences panel are available to Update-Manager and will be periodically checkedhttps://help.ubuntu.com/community/Repositories/Ubuntu?action=AttachFile&do=get&target=IconsPage%2Finfo.png+For+more+on+apt+and+authentication+keys%2C+see+%5Bhttp%3A%2F%2Fwiki.debian.org%2FSecureApt+SecureApt%5D+on+the+Debian+Wiki.++ftware repository. The maintainer will often place a copy of the authentication key on a public key server such as www.keyserver.net. The key can then be retrieved using the command

gpg --keyserver [name of keyserhttps://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=info.png+For+more+on+apt+and+authentication+keys%2C+see+%5Bhttp%3A%2F%2Fwiki.debian.org%2FSecureApt+SecureApt%5D+on+the+Debian+Wiki.++ the maintainer's authentication key as follows:

 <pre><nowiki>
gpg --keyserver subkeys.pgp.net --recv-keys 1135D466 

Ubuntu?action=AttachFile&do=get&target=IconsPage%2Finfo.png tu's apt trusted keys database with the following command

gpg --export --armor 1135D466 | sudo apt-key add - 
  • Note there's a dash at the end of the line


attachment:IconsPage/info.png For more on apt and authentication keys, see SecureApt on the Debian Wiki.



See also

  • [[UbuntuHelp:../CommandLine| Managing Software Repositories from the Command Line]]
  • [[UbuntuHelp:../Kubuntu| Managing Software Repositories in Kubuntu]]
  • man pages
    • sources.list