第 6 章 维护和更新:APT 工具
What makes Debian so popular with administrators is how easily software can be installed and how easily the whole system can be updated. This unique advantage is largely due to the APT program, which Falcot Corp administrators studied with enthusiasm.
APT is the abbreviation for Advanced Package Tool. What makes this program “advanced” is its approach to packages. It doesn’t simply evaluate them individually, but it considers them as a whole and produces the best possible combination of packages depending on what is available and compatible according to dependencies.
词汇 软件源和源代码软件包
The word source can be ambiguous. A “source package” — a package containing the source code of a program — should not be confused with a “package source” — a repository (website, FTP server, CD-ROM, local directory, etc.) which contains packages.
APT needs to be given a “list of package sources (repositories)”: the file /etc/apt/sources.list
will list the different repositories that publish Debian packages. APT will then import the list of packages published by each of these sources. This operation is achieved by downloading Packages.xz
files or a variant such as Packages.gz
or .bz2
(using a different compression method) in case of a source of binary packages and by analyzing their contents. In case of a source of source packages, APT downloads Sources.xz
files or a variant using a different compression method. When an old copy of these files is already present, APT can update it by only downloading the differences (see sidebar TIP Incremental updates).
回到基础 gzip
, bzip2
, LZMA
和XZ
压缩
文件名后缀.gz
表示文件经过gzip
工具的压缩。gzip
是一个经典的 Unix 命令,用于快速高效压缩文件。一些新的压缩工具更为有效,但需要更多内存和时间来完成压缩和解压。按照出现的次序,这些工具有:bzip2
(生成文件名后缀为.bz2
),lzma
(生成文件名后缀为.lzma
)和xz
(生成文件名后缀为.xz
)。