Ubuntu怎样修改软件源地址
1个回答
展开全部
本人是 Debian,不过软件包管理系统是一样的,供参考。
查看软件包 apt 的信息
*:~$ dpkg -s apt
Package: apt
Status: install ok installed
Priority: important
Section: admin
Installed-Size: 3271
Maintainer: APT Development Team <deity@lists.debian.org>
Architecture: amd64
Version: 0.9.7.9+deb7u6
Replaces: manpages-pl (<< 20060617-3~)
Depends:
libapt-pkg4.12 (>= 0.9.7.9+deb7u6), libc6 (>= 2.4), libgcc1
(>= 1:4.1.1), libstdc++6 (>= 4.6), debian-archive-keyring, gnupg
Suggests: aptitude | synaptic | wajig, dpkg-dev, apt-doc, xz-utils, python-apt
Conflicts: python-apt (<< 0.7.93.2~)
Conffiles:
/etc/logrotate.d/apt 179f2ed4f85cbaca12fa3d69c2a4a1c3
/etc/apt/apt.conf.d/01autoremove b9bbfaa2954b0499576b8d00c37d6a34
/etc/cron.daily/apt 6a9df5d143022d22b2e89fa7c1bac8aa
Description: commandline package manager
This package provides commandline tools for searching and
managing as well as querying information about packages
as a low-level access to all features of the libapt-pkg library.
.
These include:
* apt-get for retrieval of packages and information about them
from authenticated sources and for installation, upgrade and
removal of packages together with their dependencies
* apt-cache for querying available information about installed
as well as installable packages
* apt-cdrom to use removable media as a source for packages
* apt-config as an interface to the configuration settings
* apt-key as an interface to manage authentication keys
查看软件包 apt 包含的文件
*:~$ dpkg -L apt
/.
/etc
/etc/logrotate.d
/etc/logrotate.d/apt
/etc/apt
/etc/apt/preferences.d
/etc/apt/sources.list.d
/etc/apt/trusted.gpg.d
/etc/apt/apt.conf.d
/etc/apt/apt.conf.d/01autoremove
/etc/cron.daily
/etc/cron.daily/apt
/usr
/usr/share
/usr/share/doc
/usr/share/doc/apt
/usr/share/doc/apt/copyright
/usr/share/doc/apt/NEWS.Debian.gz
/usr/share/doc/apt/changelog.gz
/usr/share/doc/apt/examples
/usr/share/doc/apt/examples/sources.list
/usr/share/doc/apt/examples/apt.conf
/usr/share/doc/apt/examples/apt-https-method-example.conf.gz
/usr/share/doc/apt/examples/configure-index.gz
/usr/share/man
/usr/share/man/pt
/usr/share/man/pt/man8
/usr/share/man/pt/man8/apt-get.8.gz
/usr/share/man/pt/man8/apt-mark.8.gz
/usr/share/man/pt/man8/apt-cache.8.gz
/usr/share/man/pt/man8/apt-config.8.gz
/usr/share/man/pt/man8/apt-secure.8.gz
/usr/share/man/pt/man8/apt-cdrom.8.gz
/usr/share/man/pt/man8/apt-key.8.gz
/usr/share/man/pt/man5
/usr/share/man/pt/man5/apt_preferences.5.gz
/usr/share/man/pt/man5/apt.conf.5.gz
/usr/share/man/pt/man5/sources.list.5.gz
...
注意这个 manual:/usr/share/man/pt/man5/sources.list.5.gz
查看它
*:~$ man sources.list
你会看到
SOURCES.LIST(5) APT SOURCES.LIST(5)
NAME
sources.list - List of configured APT data sources
DESCRIPTION
The source list /etc/apt/sources.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
information available from the configured sources is acquired by apt-get update (or by an equivalent command
from another APT front-end).
Each line specifying a source starts with type (e.g. deb-src) followed by options and arguments for this
type. Individual entries cannot be continued onto a following line. Empty lines are ignored, and a #
character anywhere on a line marks the remainder of that line as a comment.
SOURCES.LIST.D
The /etc/apt/sources.list.d directory provides a way to add sources.list entries in separate files. The
format is the same as for the regular sources.list file. File names need to end with .list and may only
contain letters (a-z and A-Z), digits (0-9), underscore (_), hyphen (-) and period (.) characters. Otherwise
APT will print a notice that it has ignored a file, unless that file matches a pattern in the
Dir::Ignore-Files-Silently configuration list - in which case it will be silently ignored.
THE DEB AND DEB-SRC TYPES
The deb type references a typical two-level Debian archive, distribution/component. The distribution is
generally an archive name like stable or testing or a codename like wheezy or jessie while component is one
of main, contrib or non-free. The deb-src type references a Debian distribution's source code in the same
form as the deb type. A deb-src line is required to fetch source indexes.
The format for a sources.list entry using the deb and deb-src types is:
deb [ options ] uri distribution [component1] [component2] [...]
The URI for the deb type must specify the base of the Debian distribution, from which APT will find the
information it needs. distribution can specify an exact path, in which case the components must be omitted
and distribution must end with a slash (/). This is useful for the case when only a particular sub-section of
the archive denoted by the URI is of interest. If distribution does not specify an exact path, at least one
component must be present.
...
EXAMPLES
Uses the archive stored locally (or NFS mounted) at /home/jason/debian for stable/main, stable/contrib, and
stable/non-free.
deb file:/home/jason/debian stable main contrib non-free
As above, except this uses the unstable (development) distribution.
deb file:/home/jason/debian unstable main contrib non-free
Source line for the above
deb-src file:/home/jason/debian unstable main contrib non-free
The first line gets package information for the architectures in APT::Architectures while the second always
retrieves amd64 and armel.
deb
deb [ arch=amd64,armel ]
Uses HTTP to access the archive at archive.debian.org, and uses only the hamm/main area.
deb
Uses FTP to access the archive at ftp.debian.org, under the debian directory, and uses only the
wheezy/contrib area.
deb ftp://ftp.debian.org/debian wheezy contrib
Uses FTP to access the archive at ftp.debian.org, under the debian directory, and uses only the
unstable/contrib area. If this line appears as well as the one in the previous example in sources.list a
single FTP session will be used for both resource lines.
deb ftp://ftp.debian.org/debian unstable contrib
Uses HTTP to access the archive at ftp.tlh.debian.org, under the universe directory, and uses only files
found under unstable/binary-i386 on i386 machines, unstable/binary-amd64 on amd64, and so forth for other
supported architectures. [Note this example only illustrates how to use the substitution variable; official
debian archives are not structured like this]
deb
$(ARCH)/
...
里面讲了怎么修改软件源列表,具体请自己查看。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询