Linux package source list

sources.list(5) — Linux man page

The package resource list is used to locate archives of the package distribution system in use on the system. This control file is located in /etc/apt/sources.list and additionally any files ending with «.list» in /etc/apt/sources.list.d are included.

The source list is designed to support any number of active sources and a variety of source media. The file lists one source per line, with the most preferred source listed first. The format of each line is: type uri args. The first item, type, determines the format for args. uri is a Universal Resource Identifier (URI), which is a superset of the more specific and well-known Universal Resource Locator, or URL. The rest of the line can be marked as a comment by using a #.

The generic format of sources.list entry is: type baseuri distribution [component comp2 . ]

Type is one of the types explained below. Baseuri is the URI to the root of the given distribution. Distribution points to a given distribution name, version and architecture. The splitting of URI into baseuri and distribution parts should be done in a way that allows pointing the baseuri to another mirror without touching distribution. Some types additionally support a component-entry.

The following variable substitutions are done on sources.list entries: $(ARCH) is substituted with the base architecture of the system.

$(VERSION) is substituted with the distribution version if configured automatically via Apt::DistroVerPkg or manually via the Apt::DistroVersion configuration option.

the Repomd and Repomd-src Types

The format of repomd and repomd-src sources.list entries is: repomd baseuri distribution repomd-src baseuri distribution

Repomd repositories do not support a concept of «components»!

the Rpm and Rpm-src Types

The format of rpm and rpm-src sources.list entries is: rpm baseuri distribution component [comp2 . ] rpm-src baseuri distribution component [comp2 . ]

At least one component must be specified for rpm and rpm-src repositories.

the Rpm-dir and Rpm-src-dir Types

The format of rpm-dir and rpm-src-dir sources.list entries is: rpm-dir baseuri distribution component [comp2 . ] rpm-src-dir baseuri distribution component [comp2 . ]

At least one component must be specified for rpm and rpm-src repositories. rpm-dir and rpm-src-dir only accept file:// uri’s!

Читайте также:  Linux time save to file

Uri Specification

The currently recognized URI types are cdrom, file, http, and ftp. file The file scheme allows an arbitrary directory in the file system to be considered an archive. This is useful for NFS mounts and local mirrors or archives. cdrom The cdrom scheme allows APT to use a local CDROM drive with media swapping. Use the apt-cdrom(8) program to create cdrom entries in the source list. http The http scheme specifies an HTTP server for the archive. If the «http_proxy» environment variable is set with the format «http://server:port/», the proxy server specified in «http_proxy» will be used. Users of authenticated HTTP/1.1 proxies may use a string of the format «http://user:pass@server:port/». Note that this is an insecure method of authentication. ftp The ftp scheme specifies an FTP server for the archive. APT’s FTP behavior is highly configurable; for more information see the apt.conf(5) manual page. Please note that a ftp proxy can be specified by using the «ftp_proxy» environment variable. It is possible to specify a http proxy (http proxy servers often understand ftp urls) using this method and ONLY this method. ftp proxies using http specified in the configuration file will be ignored. copy The copy scheme is identical to the file scheme except that packages are copied into the cache directory instead of used directly at their location. This is useful for people using a zip disk to copy files around with APT. rsh See below. ssh The rsh/ssh method invokes rsh/ssh to connect to a remote host as a given user and access the files. No password authentication is possible, prior arrangements with RSA keys or rhosts must have been made. Access to files on the remote uses standard find(1) and dd(P) commands to perform the file transfers from the remote.

Examples

Repomd entries for Fedora Core, Extras and Updates using variable substitution, assumes Apt::DistroVerPkg is set to «fedora-release»:
repomd http://download.fedora.redhat.com/pub/ fedora/linux/core/$(VERSION)/$(ARCH)/os/repomd http://download.fedora.redhat.com/pub/ fedora/linux/extras/$(VERSION)/$(ARCH)/repomd http://download.fedora.redhat.com/pub/ fedora/linux/core/updates/$(VERSION)/$(ARCH)/

Local mirror (local disk, NFS mounted etc) of Fedora Core at /var/www/html/fedora/
repomd file:/var/www/html fedora/linux/core/$(VERSION)/$(ARCH)/

Источник

Repositories / CommandLine

IconsPage/terminal.png

This page describes how to manage software repositories from the command line. (GUI tools are also available: Managing Repositories in Ubuntu or Kubuntu).

IconsPage/important.png

If you are using a minimal install or server install you will need to be familiar with a terminal based text editor like nano. If you are using a GUI install you can use Nano or GEdit.

Читайте также:  Kali linux изменить разрешение экрана

The Basics

Ubuntu uses apt for package management. Apt stores a list of repositories or software channels in the file

and in any file with the suffix .list under the directory

See man sources.list for more about this storage mechanism.

IconsPage/note.png

By editing these files from the command line, we can add, remove, or temporarily disable software repositories.

    Note: 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

Typically, the beginning of the file /etc/apt/sources.list looks like this:

# sources.list #deb cdrom:[Ubuntu 13.10 _Saucy Salamander_ - Release i386 (20131016.1)]/ saucy main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://ch.archive.ubuntu.com/ubuntu/ saucy main restricted deb-src http://ch.archive.ubuntu.com/ubuntu/ saucy main restricted #.

Explanation of the Repository Format

  • All the lines beginning with one or two hashes (#) are comments, for information only.
  • The lines without hashes are apt repository lines. Here’s what they say:
    • deb: These repositories contain binaries or precompiled packages. These repositories are required for most users.
    • deb-src: These repositories contain the source code of the packages. Useful for developers.
    • http://archive.ubuntu.com/ubuntu: The URI (Uniform Resource Identifier), in this case a location on the internet. See the official mirror list or the self-maintained mirror list to find other mirrors.
    • saucy is the release name or version of your distribution.
    • main & restricted are the section names or components. There can be several section names, separated by spaces.

    Other Versions

    IconsPage/note.png

    • For other Ubuntu releases you would replace the ‘saucy’ with the current version you have installed (‘precise’, ‘quantal’, ‘raring’, ‘saucy’, ‘trusty’, . ) Type lsb_release -sc to find out your release.

    Adding Repositories

    Adding the Universe and Multiverse Repositories

    deb http://us.archive.ubuntu.com/ubuntu/ saucy universe deb-src http://us.archive.ubuntu.com/ubuntu/ saucy universe deb http://us.archive.ubuntu.com/ubuntu/ saucy-updates universe deb-src http://us.archive.ubuntu.com/ubuntu/ saucy-updates universe

    There are four similar lines for ‘multiverse’.

    sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ saucy universe multiverse" sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ saucy-updates universe multiverse"

    IconsPage/note.png

    Depending on your location, you should replace ‘us.’ by another country code, referring to a mirror server in your region. Check sources.list to see what is used!

    Type lsb_release -sc to find out your release. You may repeat the commands with «deb-src» instead of «deb» in order to install the source files.

    Adding Partner Repositories

    deb http://archive.canonical.com/ubuntu saucy partner deb-src http://archive.canonical.com/ubuntu saucy partner

    IconsPage/important.png

    Be aware that the software contained within this repository is NOT open source.

Adding Other Repositories

There are some reasons for which you might want to add non-Ubuntu repositories to your list of software sources. Caution: To avoid trouble with your sytem, only add repositories that are trustworthy and that are known to work on Ubuntu systems!

    You can add custom software repositories by adding the apt repository line of your software source to the end of the sources.list file. It should look something like this:

deb http://mirror3.ubuntulinux.nl/ hardy-seveas freenx

Adding Launchpad PPA Repositories

  • The command updates your sources.list file or adds/edits files under sources.list.d/. Type man add-apt-repository for detailed help.
  • If a public key is required and available it is automatically downloaded and registered.
  • Should be installed by default. On older or minimal Ubuntu releases, you may have to install software-properties-common and/or python-software-properties first (sudo apt-get install python-software-properties)

sudo add-apt-repository ppa:

Enabling Repositories with a (non-interactive) Script

IconsPage/note.png

This section seemed obsolete due to the add-apt-repository command, thus it has been removed.

Suggestions & Recommendations

  • It is always a good idea to back up configuration files like /etc/apt/sources.list before you begin editing. You can then revert your changes if needed.
  • If you decide to add other repositories to sources.list, make sure that the repository is meant to work (and known to work) with Ubuntu. 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. Also, make sure that you really need to add external repositories as the software package(s) you are looking for may already have been introduced into the official repositories!
  • Please keep in mind that it may not be legal (typically because of export restrictions) to enable some non-Ubuntu software repositories in some countries.
  • You may be asked enter a security key when adding a non-Ubuntu repository to your sources. See Managing Authentication Keys for instructions.
  • Remember to retrieve updated package lists by issuing a sudo apt-get update when you’re done editing sources.list.

Further Reading

Repositories/CommandLine (последним исправлял пользователь 2580DCEA 2015-07-27 15:42:33)

The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details

Источник

Оцените статью
Adblock
detector