debian-faq 8.1 - en to zh_CN translation catalogue (114 entries)

note: type: Content of: <chapter><title>
en: Basics of the Debian package management system
zh_CN: Debian 软件包管理系统基础

note: type: Content of: <chapter><para>
en: This chapter touches on some lower level internals of Debian package management.  If you're interested mainly in <emphasis>usage</emphasis> of the relevant tools, skip to chapters <xref linkend="pkgtools"/> and/or <xref linkend="uptodate"/>.
zh_CN: 本章涉及 Debian 包管理系统的一些底层细节。如果您主要是想了解相关工具的<emphasis>用法</emphasis>，请跳过本章，并阅读<xref linkend="pkgtools"/>和/或<xref linkend="uptodate"/>。

note: type: Content of: <chapter><section><title>
en: What is a Debian package?
zh_CN: 什么是 Debian 软件包？

note: type: Content of: <chapter><section><para>
en: Packages generally contain all of the files necessary to implement a set of related commands or features.  There are two types of Debian packages:
zh_CN: 软件包通常包括了实现一组互相关联的命令或功能所需要的一切文件。Debian 软件包有两种类型：

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: <emphasis>Binary packages</emphasis>, which contain executables, configuration files, man/info pages, copyright information, and other documentation.  These packages are distributed in a Debian-specific archive format (see <xref linkend="deb-format"/>); they are usually characterized by having a '.deb' file extension.  Binary packages can be unpacked using the Debian utility <literal>dpkg</literal> (possibly via a frontend like <command>apt</command>); details are given in its manual page.
zh_CN: <emphasis>二进制包</emphasis>，包含了可执行文件、配置文件、man/info 页面、版权信息，以及其他文档。这些软件包使用一种 Debian 特有的存储格式进行分发（参见<xref linkend="deb-format"/>）；它们的扩展名通常是“.deb”。二进制包可以使用 Debian 的 <literal>dpkg</literal> 工具进行解包（也许会通过 <command>apt</command> 等前端进行调用）；更多细节请阅读手册页。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: <emphasis>Source packages</emphasis>, which consist of a <literal>.dsc</literal> file describing the source package (including the names of the following files), a <literal>.orig.tar.gz</literal> file that contains the original unmodified source in gzip-compressed tar format and usually a <literal>.debian.tar.xz</literal> file that contains the Debian-specific changes to the original source.  The utility <literal>dpkg-source</literal> packs and unpacks Debian source archives; details are provided in its manual page.  (The program <command>apt-get</command> can be used as a frontend for <literal>dpkg-source</literal>.)
zh_CN: <emphasis>源码包</emphasis>，包含了一个 <literal>.dsc</literal> 文件描述该源码包（包括下述文件的文件名），一个 <literal>.orig.tar.gz</literal> 文件，使用经过 gzip 压缩的 tar 档案保存未经修改的源代码，通常还包括一个 <literal>.debian.tar.xz</literal> 文件，保存了 Debian 对源代码的修改。<literal>dpkg-source</literal> 工具可以打包和解包 Debian 源码包；更多细节请阅读手册页。（<command>apt-get</command> 程序可以用作 <literal>dpkg-source</literal> 的前端。）

note: type: Content of: <chapter><section><para>
en: Installation of software by the package system uses "dependencies" which are carefully designed by the package maintainers.  These dependencies are documented in the <literal>control</literal> file associated with each package.  For example, the package containing the GNU C compiler (<systemitem role="package">gcc</systemitem>) "depends" on the package <systemitem role="package">binutils</systemitem> which includes the linker and assembler.  If a user attempts to install <systemitem role="package">gcc</systemitem> without having first installed <systemitem role="package">binutils</systemitem>, the package management system (dpkg) will send an error message that it also needs <systemitem role="package">binutils</systemitem>, and stop installing <systemitem role="package">gcc</systemitem>.  (However, this facility can be overridden by the insistent user, see <citerefentry><refentrytitle>dpkg</refentrytitle><manvolnum>8</manvolnum></citerefentry>.)  See more in <xref linkend="depends"/> below.
zh_CN: 软件包管理系统使用“依赖关系”安装软件，这些依赖由软件包的维护者小心地指定。依赖关系在每个软件包含有的 <literal>control</literal> 文件里给出。例如，包含 GNU C 编译器的软件包（<systemitem role="package">gcc</systemitem>）“依赖”软件包 <systemitem role="package">binutils</systemitem>，后者包含了链接器和汇编器。如果用户在没有安装 <systemitem role="package">binutils</systemitem> 的情况下尝试安装 <systemitem role="package">gcc</systemitem>，包管理系统（dpkg）会给出一条错误信息，提示它依赖 <systemitem role="package">binutils</systemitem>，并停止安装 <systemitem role="package">gcc</systemitem>。（不过，如果用户坚持，这个功能可以被覆盖，参见 <citerefentry><refentrytitle>dpkg</refentrytitle><manvolnum>8</manvolnum></citerefentry>）。阅读下方的<xref linkend="depends"/>以了解更多信息。

note: type: Content of: <chapter><section><para>
en: Debian's packaging tools can be used to:
zh_CN: Debian 的包管理工具可以用于：

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: manipulate and manage packages or parts of packages,
zh_CN: 操作和管理软件包或其组成部分，

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: administer local overrides of files in a package,
zh_CN: 管理软件包在本地覆盖的文件，

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: aid developers in the construction of package archives, and
zh_CN: 帮助开发者建立软件包档案库，以及

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: aid users in the installation of packages which reside on a remote archive site.
zh_CN: 帮助用户从远程档案库站点安装软件包。

note: type: Content of: <chapter><section><title>
en: What is the format of a Debian binary package?
zh_CN: Debian 二进制软件包的格式是什么？

note: type: Content of: <chapter><section><para>
en: The internals of this Debian binary packages format are described in the <citerefentry><refentrytitle>deb</refentrytitle><manvolnum>5</manvolnum></citerefentry> manual page.  This internal format is subject to change (between major releases of &debian;), therefore please always use <citerefentry><refentrytitle>dpkg-deb</refentrytitle><manvolnum>1</manvolnum></citerefentry> if you need to do lowlevel manipulations on <literal>.deb</literal> files.
zh_CN: Debian 二进制包格式的内部细节在 <citerefentry><refentrytitle>deb</refentrytitle><manvolnum>5</manvolnum></citerefentry> 手册页中有描述。这一内部格式可能会发生变化（在 &debian; 的各个主要版本之间），所以如果您需要对 <literal>.deb</literal> 文件进行底层操作，请总是使用 <citerefentry><refentrytitle>dpkg-deb</refentrytitle><manvolnum>1</manvolnum></citerefentry>。

note: type: Content of: <chapter><section><title>
en: Why are Debian package file names so long?
zh_CN: 为什么 Debian 软件包的文件名这么长？

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: inspect the "Packages" file in the directory where it was stored at a Debian archive site.  This file contains a stanza describing each package; the first field in each stanza is the formal package name.
zh_CN: 在 Debian 档案站点存储它的目录中检查“Packages”文件。该文件对每个软件包都有一节简要的信息；每节的第一行就是正式的包名。

note: type: Content of: <chapter><section><para>
en: The <literal>VVV</literal> component is the version number specified by the upstream developer.  There are no standards in place here, so the version number may have formats as different as "19990513" and "1.3.8pre1".
zh_CN: <literal>VVV</literal> 部分是上游开发者指定的版本号。版本号没有固定的标准，所以可能出现诸如“19990513”和“1.3.8pre1”之类迥异的格式。

note: type: Content of: <chapter><section><para>
en: The <literal>RRR</literal> component is the Debian revision number, and is specified by the Debian developer (or a user who chooses to rebuild the package locally).  This number corresponds to the revision level of the Debian package, thus, a new revision level usually signifies changes in the Debian Makefile (<literal>debian/rules</literal>), the Debian control file (<literal>debian/control</literal>), the installation or removal scripts (<literal>debian/p*</literal>), or in the configuration files used with the package.
zh_CN: <literal>RRR</literal> 部分是 Debian 修订版本号，由 Debian 开发者指定（如果用户自己构建软件包，则由用户指定）。这一数字对应了 Debian 软件包的修订级别，所以，一个新的修订级别通常意味着对该软件包的 Debian Makefile（<literal>debian/rules</literal>）、Debian 控制文件（<literal>debian/control</literal>）、安装或卸载脚本（<literal>debian/p*</literal>），或者配置文件的修改。

note: type: Content of: <chapter><section><para>
en: The <literal>AAA</literal> component identifies the processor for which the package was built.  This is commonly <literal>amd64</literal>, which refers to AMD64, Intel 64 or VIA Nano chips.  For other possibilities review Debian's archive directory structure at <xref linkend="dirtree"/>.  For details, see the description of "Debian architecture" in the manual page <citerefentry><refentrytitle>dpkg-architecture</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
zh_CN: <literal>AAA</literal> 部分给出了该软件包针对的处理器。常见的是 <literal>amd64</literal>，也就是 AMD64、Intel 64 或者 VIA Nano 处理器。欲了解其他可能的值，请阅读<xref linkend="dirtree"/>重温 Debian 档案库的目录结构。欲了解详细信息，请阅读 <citerefentry><refentrytitle>dpkg-architecture</refentrytitle><manvolnum>1</manvolnum></citerefentry> 手册页中关于“Debian 架构”的描述。

note: type: Content of: <chapter><section><title>
en: What is a Debian control file?
zh_CN: 什么是 Debian 控制文件？

note: type: Content of: <chapter><section><para>
en: Specifics regarding the contents of a Debian control file are provided in the Debian Policy Manual, section 5, see <xref linkend="debiandocs"/>.
zh_CN: 有关 Debian 控制文件的内容的细节，请阅读 Debian 政策手册的第 5 节，参见<xref linkend="debiandocs"/>。

note: type: Content of: <chapter><section><para>
en: Briefly, a sample control file is shown below for the Debian package hello:
zh_CN: 简短地说，Debian 软件包 hello 的控制文件样例如下：

note: type: Content of: <chapter><section><para>
en: The Package field gives the package name.  This is the name by which the package can be manipulated by the package tools, and usually similar to but not necessarily the same as the first component string in the Debian archive file name.
zh_CN: Package 字段给出了软件包的名称。这个名字可以传递给软件包管理工具，以操作该软件包，且它通常与 Debian 档案文件的文件名的第一部分相似，但不一定完全相同。

note: type: Content of: <chapter><section><para>
en: The Version field gives both the upstream developer's version number and (in the last component) the revision level of the Debian package of this program as explained in <xref linkend="pkgname"/>.
zh_CN: Version 字段给出了上游开发者的版本号以及（在最后一部分）Debian 软件包的修订级别，在<xref linkend="pkgname"/>中有详细解释。

note: type: Content of: <chapter><section><para>
en: The Architecture field specifies the chip for which this particular binary was compiled.
zh_CN: Architecture 字段指明了该二进制软件包编译时针对的处理器。

note: type: Content of: <chapter><section><para>
en: The Depends field gives a list of packages that have to be installed in order to install this package successfully.
zh_CN: Depends 字段给出了安装该软件包前必须安装的软件包列表。

note: type: Content of: <chapter><section><para>
en: The Installed-Size indicates how much disk space the installed package will consume.  This is intended to be used by installation front-ends in order to show whether there is enough disk space available to install the program.
zh_CN: Installed-Size 指出了该软件包安装后会消耗多少磁盘空间。设置该字段的目的是给软件包安装前端使用，以判断是否有足够的磁盘空间安装该程序。

note: type: Content of: <chapter><section><para>
en: The Section line gives the "section" where this Debian package is stored at the Debian archive sites.
zh_CN: Section 行给出了该 Debian 软件包在 Debian 档案站点所存储的“分区”。

note: type: Content of: <chapter><section><para>
en: The Priority indicates how important is this package for installation, so that semi-intelligent software like apt or aptitude can sort the package into a category of e.g. packages optionally installed.  See <xref linkend="priority"/>.
zh_CN: Priority 指出了该软件包在安装时有多重要，这使得半智能的软件，如 apt 或 aptitude，能够将软件包分为各种类别，例如，可选择安装的软件包。参见<xref linkend="priority"/>。

note: type: Content of: <chapter><section><para>
en: The Maintainer field gives the e-mail address of the person who is currently responsible for maintaining this package.
zh_CN: Maintainer 字段给出了当前负责维护该软件包的人的电子邮件地址。

note: type: Content of: <chapter><section><para>
en: The Description field gives a brief summary of the package's features.
zh_CN: Description 字段给出了该软件包功能的简短介绍。

note: type: Content of: <chapter><section><para>
en: For more information about all possible fields a package can have, please see the Debian Policy Manual, section 5, "Control files and their fields", see <xref linkend="debiandocs"/>.
zh_CN: 要了解一个软件包可能拥有的全部字段的信息，请阅读 Debian 政策手册，第 5 节，“控制文件及其字段”，参见<xref linkend="debiandocs"/>。

note: type: Content of: <chapter><section><title>
en: What is a Debian conffile?
zh_CN: 什么是 Debian conffile？

note: type: Content of: <chapter><section><para>
en: Conffiles is a list of configuration files (usually placed in <literal>/etc</literal>) that the package management system will not overwrite when the package is upgraded.  This ensures that local values for the contents of these files will be preserved, and is a critical feature enabling the in-place upgrade of packages on a running system.
zh_CN: conffile 是软件包管理系统在升级该软件包时不会覆盖的配置文件（通常在 <literal>/etc</literal> 中）的列表。这确保了对这些文件的本地修改会被保留，因此是一个非常重要的功能，使得正在运行中的系统的软件包可以被原地升级。

note: type: Content of: <chapter><section><para>
en: To determine exactly which files are preserved during an upgrade, run:
zh_CN: 要准确得到升级时将会保留哪些文件的内容，请运行：

note: type: Content of: <chapter><section><para>
en: And look under "Conffiles:".
zh_CN: 并查看“Conffiles:”的内容。

note: type: Content of: <chapter><section><title>
en: What is a Debian preinst, postinst, prerm, and postrm script?
zh_CN: 什么是 Debian preinst、postinst、prerm，和 postrm 脚本？

note: type: Content of: <chapter><section><para>
en: These files are executable scripts which are automatically run before or after a package is installed or removed.  Along with a file named <literal>control</literal>, all of these files are part of the "control" section of a Debian archive file.
zh_CN: 这些文件是在软件包安装或卸载前后自动执行的可执行脚本。这些文件和名为 <literal>control</literal> 的文件都属于 Debian 档案文件的“控制”部分。

note: type: Content of: <chapter><section><para>
en: The individual files are:
zh_CN: 各文件分别是：

note: type: Content of: <chapter><section><variablelist><varlistentry><listitem><para>
en: This script is executed before the package it belongs to is unpacked from its Debian archive (".deb") file.  Many 'preinst' scripts stop services for packages which are being upgraded until their installation or upgrade is completed (following the successful execution of the 'postinst' script).
zh_CN: 该脚本在所属的软件包从它的 Debian 档案文件（“.deb”）中被解压之前执行。许多“preinst”脚本会停止和正在升级的软件包有关的服务，直至安装或升级完成（即在“postinst”脚本成功执行之后）。

note: type: Content of: <chapter><section><variablelist><varlistentry><listitem><para>
en: This script typically stops any daemons which are associated with a package.  It is executed before the removal of files associated with the package.
zh_CN: 该脚本通常停止与软件包有关联的服务。它在删除与软件包相关的文件之前执行。

note: type: Content of: <chapter><section><variablelist><varlistentry><listitem><para>
en: This script typically modifies links or other files associated with <literal>foo</literal>, and/or removes files created by the package.  (Also see <xref linkend="virtual"/>.)
zh_CN: 该脚本通常修改与 <literal>foo</literal> 相关的链接或其他文件，且/或删除该软件包创建的文件。（另请参见<xref linkend="virtual"/>。）

note: type: Content of: <chapter><section><para>
en: Currently all of the control files can be found in the directory <literal>/var/lib/dpkg/info</literal>.  The files relevant to package <literal>foo</literal> begin with the name "foo" and have file extensions of "preinst", "postinst", etc., as appropriate.  The file <literal>foo.list</literal> in that directory lists all of the files that were installed with the package <literal>foo</literal>.  (Note that the location of these files is a dpkg internal; you should not rely on it.)
zh_CN: 目前所有控制文件都可以在 <literal>/var/lib/dpkg/info</literal> 目录中找到。与软件包 <literal>foo</literal> 有关的文件会以“foo”打头，并且，如果适用的话，扩展名会是“preinst”、“postinst”等。该目录中的 <literal>foo.list</literal> 文件列出了软件包 <literal>foo</literal> 安装的所有文件。（注意，这些文件的路径是一个 dpkg 内部变量；您不应当依赖它。）

note: type: Content of: <chapter><section><title>
en: What is an <emphasis>Essential</emphasis>, <emphasis>Required</emphasis>, <emphasis>Important</emphasis>, <emphasis>Standard</emphasis>, <emphasis>Optional</emphasis>, or <emphasis>Extra</emphasis> package?
zh_CN: 什么是<emphasis>必备</emphasis>、<emphasis>必需</emphasis>、<emphasis>重要</emphasis>、<emphasis>标准</emphasis>、<emphasis>可选</emphasis>和<emphasis>额外</emphasis>软件包？

note: type: Content of: <chapter><section><para>
en: Each Debian package is assigned a <emphasis>priority</emphasis> by the distribution maintainers, as an aid to the package management system.  The priorities are:
zh_CN: 每一个 Debian 软件包都被发行版的维护者赋予了一个<emphasis>优先级</emphasis>，以辅助软件包管理系统。优先级有：

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: <emphasis role="strong">Required</emphasis>: packages that are necessary for the proper functioning of the system.
zh_CN: <emphasis role="strong">必需（Required）</emphasis>：系统正常运行必需的软件包。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: This includes all tools that are necessary to repair system defects.  You must not remove these packages or your system may become totally broken and you may probably not even be able to use dpkg to put things back.  Systems with only the Required packages are probably unusable, but they do have enough functionality to allow the sysadmin to boot and install more software.
zh_CN: 这包括了所有修复系统故障所必需的软件包。您不可以卸载这些软件包，否则您的系统可能完全损坏，而您甚至可能无法使用 dpkg 来修复它。只包含“必需”软件包的系统或许无法使用，但却足以让系统管理员引导系统并安装更多软件。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: <emphasis role="strong">Important</emphasis> packages should be found on any Unix-like system.
zh_CN: <emphasis role="strong">重要（Important）</emphasis> 软件包应当能在任何类 Unix 系统上找到。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: Other packages which the system will not run well or be usable without will be here.  This does <emphasis>NOT</emphasis> include Emacs or X or TeX or any other large application.  These packages only constitute the bare infrastructure.
zh_CN: 其他能使系统正常运行或可以正常使用的软件包会出现在这里。这<emphasis>不</emphasis>包括 Emacs 或 X 或 TeX，或任何其他的大型应用程序。这些软件包仅能构成最基本的基础架构。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: <emphasis role="strong">Standard</emphasis> packages are standard on any Linux system, including a reasonably small but not too limited character-mode system.  Tools are included to be able to send e-mail (with mutt) and download files from archive servers.
zh_CN: <emphasis role="strong">标准（Standard）</emphasis> 软件包是任何 Linux 系统的标准组成部分，包含了一个较小的，但功能不会太受限的字符模式的系统。它包含了可以用来发送电子邮件（使用 mutt）以及从档案服务器下载文件的工具。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: This is what will be installed by default if users do not select anything else.  It does not include many large applications, but it does include the Python interpreter and some server software like OpenSSH (for remote administration)  and Exim (for mail delivery, although it can be configured for local delivery only).  It also includes some common generic documentation that most users will find helpful.
zh_CN: 这是用户在其他选项都不选的情况下默认会安装的软件包。它不包括很多大型应用程序，但确实包含了 Python 解释器和一些服务器软件，例如 OpenSSH（用于远程管理）和 Exim（用于发送邮件，虽然可以配置为只发送本地邮件）。它也包含了一些许多用户觉得有用的通用文档。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: <emphasis role="strong">Optional</emphasis> packages include all those that you might reasonably want to install if you do not know what they are, or that do not have specialized requirements.
zh_CN: <emphasis role="strong">可选（Optional）</emphasis> 软件包包括了所有在您不认识它们的情况下可能想要安装的软件包，或者没有特殊系统需求的软件包。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: This includes X, a full TeX distribution, and lots of applications.
zh_CN: 这包括 X，完整的 TeX 发行版，以及很多应用程序。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: <emphasis role="strong">Extra</emphasis>: packages that either conflict with others with higher priorities, are only likely to be useful if you already know what they are, or have specialized requirements that make them unsuitable for "Optional".
zh_CN: <emphasis role="strong">额外（Extra）</emphasis>：这里的软件包和其他更高优先级的软件包冲突，或者只在您知道它们是什么的情况下可能有用，或者有其他特殊的系统需求，因此不适合放在“可选”。

note: type: Content of: <chapter><section><para>
en: If you do a default Debian installation all the packages of priority <emphasis role="strong">Standard</emphasis> or higher will be installed in your system.  If you select pre-defined tasks you will get lower priority packages too.
zh_CN: 如果您进行一次 Debian 默认安装，所有优先级为<emphasis role="strong">标准</emphasis>或更高的软件包都会被安装在您的系统上，如果您选择了预定义的任务软件包，您还会同时获得更低优先级的软件包。

note: type: Content of: <chapter><section><para>
en: Additionally, some packages are marked as <emphasis role="strong">Essential</emphasis> since they are absolutely necessary for the proper functioning of the system.  The package management tools will refuse to remove these.
zh_CN: 另外，有些软件包被标记为 <emphasis role="strong">必备（Essential）</emphasis>，因为系统必须要有它们才能正常运行。软件包管理工具会拒绝卸载这些软件包。

note: type: Content of: <chapter><section><title>
en: What is a Virtual Package?
zh_CN: 什么是虚拟软件包？

note: type: Content of: <chapter><section><para>
en: A virtual package is a generic name that applies to any one of a group of packages, all of which provide similar basic functionality.  For example, both the <literal>konqueror</literal> and <literal>firefox-esr</literal> programs are web browsers, and should therefore satisfy any dependency of a program that requires a web browser on a system, in order to work or to be useful.  They are therefore both said to provide the "virtual package" called <literal>www-browser</literal>.
zh_CN: 虚拟软件包是一个通用的名称，适合称呼一组软件包中的任意一个，所有软件包都提供相似的基本功能。例如，<literal>konqueror</literal> 和 <literal>firefox-esr</literal> 都是网页浏览器，所以应该能满足系统中所有需要安装浏览器才能工作或好用的程序的依赖关系。所以我们说它们两个都提供了名为 <literal>www-browser</literal> 的“虚包”。

note: type: Content of: <chapter><section><para>
en: Similarly, <literal>exim4</literal> and <literal>sendmail</literal> both provide the functionality of a mail transport agent.  They are therefore said to provide the virtual package "mail-transport-agent".  If either one is installed, then any program depending on the installation of a <literal>mail-transport-agent</literal> will be satisfied by the presence of this virtual package.
zh_CN: 类似地，<literal>exim4</literal> 和 <literal>sendmail</literal> 都提供了邮件客户端的功能。所以我们说它们都提供了虚包“mail-transport-agent”。如果已经安装了其中的任意一个，那么任何依赖 <literal>mail-transport-agent</literal> 的程序都会因为这一虚包的存在而满足了依赖关系。

note: type: Content of: <chapter><section><para>
en: Debian provides a mechanism so that, if more than one package which provide the same virtual package is installed on a system, then system administrators can set one as the preferred package.  The relevant command is <literal>update-alternatives</literal>, and is described further in <xref linkend="diverse"/>.
zh_CN: Debian 提供了一种机制，如果有提供同一虚包的多个软件包安装在系统上，系统管理员可以选择一个作为偏好的软件包。相关的命令是 <literal>update-alternatives</literal>，在<xref linkend="diverse"/>中有更详细的描述。

note: type: Content of: <chapter><section><title>
en: What is meant by saying that a package <emphasis>Depends</emphasis>, <emphasis>Recommends</emphasis>, <emphasis>Suggests</emphasis>, <emphasis>Conflicts</emphasis>, <emphasis>Replaces</emphasis>, <emphasis>Breaks</emphasis> or <emphasis>Provides</emphasis> another package?
zh_CN: 一个软件包<emphasis>依赖</emphasis>、<emphasis>推荐</emphasis>、<emphasis>建议</emphasis>、<emphasis>冲突</emphasis>、<emphasis>替代</emphasis>、<emphasis>破坏</emphasis>或者<emphasis>提供</emphasis>另一个软件包是什么意思？

note: type: Content of: <chapter><section><para>
en: The Debian package system has a range of package "dependencies" which are designed to indicate (in a single flag) the level at which Program A can operate independently of the existence of Program B on a given system:
zh_CN: Debian 软件包管理系统有一系列的软件包“依赖关系”，设计目的是（用单一的标志）表明在给定系统中程序 A 能够脱离程序 B 独立运行的程度：

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: Package A <emphasis>depends</emphasis> on Package B if B absolutely must be installed in order to run A.  In some cases, A depends not only on B, but on a version of B.  In this case, the version dependency is usually a lower limit, in the sense that A depends on any version of B more recent than some specified version.
zh_CN: 如果运行软件包 A 前必须先安装软件包 B，那么 A <emphasis>依赖（depend）</emphasis>B。某些情况下，A 不仅依赖于 B，还依赖 B 的某个版本。这种情况下，依赖的版本号通常是一个下限，也就是 A 依赖于 B 的比某一指定的版本更新的任何版本。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: Package A <emphasis>recommends</emphasis> Package B, if the package maintainer judges that most users would not want A without also having the functionality provided by B.
zh_CN: 如果软件包维护者认为大多数用户在没有软件包 B 提供的功能的情况下，就不会愿意安装软件包 A，那么 A <emphasis>推荐（recommend）</emphasis>B。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: Package A <emphasis>suggests</emphasis> Package B if B contains files that are related to (and usually enhance) the functionality of A.
zh_CN: 如果软件包 B 包含的文件和软件包 A 的功能有关（并且往往会增强该功能），那么 A <emphasis>建议（suggest）</emphasis>B。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: Package A <emphasis>conflicts</emphasis> with Package B when A will not operate if B is installed on the system.  Most often, conflicts are cases where A contains files which are an improvement over those in B.  "Conflicts" are often combined with "replaces".
zh_CN: 如果软件包 B 安装于系统上，软件包 A 就无法工作，那么 A <emphasis>冲突（conflict）</emphasis>B。最常见的情况是，A 包含的某些文件是对 B 的文件的改进。“冲突”通常和“替代”同时出现。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: Package A <emphasis>replaces</emphasis> Package B when files installed by B are removed and (in some cases) over-written by files in A.
zh_CN: 如果软件包 B 的文件被软件包 A 删除或者（在某些情况下）覆盖，那么 A <emphasis>替代（replace）</emphasis>B。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: Package A <emphasis>breaks</emphasis> Package B when both packages cannot be simultaneously configured in a system.  The package management system will refuse to install one if the other one is already installed and configured in the system.
zh_CN: 如果软件包 A 和软件包 B 无法同时配置在同一系统上，那么 A <emphasis>破坏（break）</emphasis>B。如果其中一个软件包在系统中已经处于已安装且已配置的状态，软件包管理系统会拒绝安装另外一个。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: Package A <emphasis>provides</emphasis> Package B when all of the files and functionality of B are incorporated into A.  This mechanism provides a way for users with constrained disk space to get only that part of package A which they really need.
zh_CN: 如果软件包 B 的所有文件和功能都已经整合进了软件包 A，那么 A <emphasis>提供（provide）</emphasis>B。这个机制帮助磁盘空间有限的用户只安装软件包 A 中他们真正需要的部分。

note: type: Content of: <chapter><section><para>
en: More detailed information on the use of each of these terms can be found in the Debian Policy manual, section 7.2, "Binary Dependencies", see <xref linkend="debiandocs"/>.
zh_CN: 关于以上术语的使用方式的更多细节，请阅读 Debian 政策手册，第 7.2 节，“Binary Dependencies”，并请参见<xref linkend="debiandocs"/>。

note: type: Content of: <chapter><section><title>
en: What is meant by Pre-Depends?
zh_CN: “预依赖”是什么意思？

note: type: Content of: <chapter><section><para>
en: "Pre-Depends" is a special dependency.  In the case of most packages, <literal>dpkg</literal> will unpack the archive file of a package (i.e., its <literal>.deb</literal> file) independently of whether or not the files on which it depends exist on the system.  Simplistically, unpacking means that <literal>dpkg</literal> will extract the files from the archive file that were meant to be installed on your file system, and put them in place.  If those packages <emphasis>depend</emphasis> on the existence of some other packages on your system, <literal>dpkg</literal> will refuse to complete the installation (by executing its "configure" action) until the other packages are installed.
zh_CN: “预依赖（Pre-Depend）”是一种特殊的依赖关系。在多数情况下，<literal>dpkg</literal> 不管软件包档案文件（即 <literal>.deb</literal> 文件）依赖的软件包存不存在，都会解压该档案。简单地说，解压缩意味着 <literal>dpkg</literal> 将准备安装的软件包里的各个文件解压到您的文件系统中，并放在正确的位置。如果该软件包<emphasis>依赖</emphasis>于您系统中没有的其他软件包，<literal>dpkg</literal> 会拒绝完成安装进程（也就是拒绝执行“配置”步骤），直到它依赖的软件包被安装。

note: type: Content of: <chapter><section><para>
en: However, for some packages, <literal>dpkg</literal> will refuse even to unpack them until certain dependencies are resolved.  Such packages are said to "Pre-depend" on the presence of some other packages.  The Debian project provided this mechanism to support the safe upgrading of systems from <literal>a.out</literal> format to <literal>ELF</literal> format, where the <emphasis>order</emphasis> in which packages were unpacked was critical.  There are other large upgrade situations where this method is useful, e.g. the packages with the required priority and their LibC dependency.
zh_CN: 但是，对于某些软件包，<literal>dpkg</literal> 甚至会在依赖关系解决前拒绝解压缩它们。我们称这类软件包“预依赖”某些其他的软件包。Debian 利用这种机制完成从 <literal>a.out</literal> 格式到 <literal>ELF</literal> 格式的升级，因为在这种情况下，软件包解压缩的<emphasis>顺序</emphasis>是至关重要的。这一方法还能用于其他重大的升级，例如优先级为“必需”且依赖 LibC 的软件包。

note: type: Content of: <chapter><section><para>
en: As before, more detailed information about this can be found in the Policy manual.
zh_CN: 和以前一样，关于这一机制的更多细节可以在政策手册中找到。

note: type: Content of: <chapter><section><title>
en: What is meant by <emphasis>unknown</emphasis>, <emphasis>install</emphasis>, <emphasis>remove</emphasis>, <emphasis>purge</emphasis> and <emphasis>hold</emphasis> in the package status?
zh_CN: 软件包状态中的<emphasis>未知</emphasis>、<emphasis>安装</emphasis>、<emphasis>卸载</emphasis>、<emphasis>清除</emphasis>和<emphasis>保留</emphasis>都是什么意思？

note: type: Content of: <chapter><section><para>
en: These "want" flags tell what the user wanted to do with a package (as indicated by the user's direct invocations of <literal>dpkg</literal>/<literal>apt</literal>/ <literal>aptitude</literal>).
zh_CN: 这些“想要”标志表示用户想要对软件包做什么（通过用户对 <literal>dpkg</literal>/<literal>apt</literal>/ <literal>aptitude</literal> 的直接调用表达出来）。

note: type: Content of: <chapter><section><para>
en: Their meanings are:
zh_CN: 他们的意思分别是：

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: unknown - the user has never indicated whether the package is wanted.
zh_CN: 未知（unknown）：用户从未表示是否需要该软件包。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: install - the user wants the package installed or upgraded.
zh_CN: 安装（install）：用户希望该软件包被安装或升级。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: remove - the user wants the package removed, but does not want to remove any existing configuration file.
zh_CN: 卸载（remove）：用户希望该软件包被卸载，但不希望删除任何已存在的配置文件。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: purge - the user wants the package to be removed completely, including its configuration files.
zh_CN: 清除（purge）：用户希望该软件包被完全卸载，包括配置文件。

note: type: Content of: <chapter><section><itemizedlist><listitem><para>
en: hold - the user wants this package not to be processed, i.e. wants to keep the current version with the current status whatever that is.
zh_CN: 保留（hold）：用户不希望处理该软件包，也就是希望保持当前的版本和当前的状态，无论是什么。

note: type: Content of: <chapter><section><title>
en: How do I put a package on hold?
zh_CN: 如何将软件包设置为“保留”？

note: type: Content of: <chapter><section><para>
en: There are three ways of holding back packages, with dpkg, apt or aptitude.
zh_CN: 有三种方法将软件包设置为“保留”，分别是用 dpkg、apt 和 aptitude。

note: type: Content of: <chapter><section><para>
en: With dpkg, you have to export the list of package selections, with:
zh_CN: 如果使用 dpkg，您需要先使用如下命令导出已选择的软件包：

note: type: Content of: <chapter><section><para>
en: Then edit the resulting file <filename>selections.txt</filename>, change the line containing the package you wish to hold, e.g. <systemitem role="package">libc6</systemitem>, from this:
zh_CN: 然后编辑生成的文件 <filename>selections.txt</filename>，将您想要设为“保留”的软件包，例如 <systemitem role="package">libc6</systemitem> 所在的行，由：

note: type: Content of: <chapter><section><para>
en: to this:
zh_CN: 改为：

note: type: Content of: <chapter><section><para>
en: Save the file, and reload it into dpkg database with:
zh_CN: 然后保存文件，并使用以下命令将它加载到 dpkg 数据库：

note: type: Content of: <chapter><section><para>
en: With apt, you can set a package to hold using
zh_CN: 如果使用 apt，您可以使用以下命令将软件包设为“保留”：

note: type: Content of: <chapter><section><para>
en: and remove the hold with
zh_CN: 或使用以下命令取消“保留”：

note: type: Content of: <chapter><section><para>
en: With aptitude, you can hold a package using
zh_CN: 如果使用 aptitude，您可以使用以下命令将软件包设为“保留”：

note: type: Content of: <chapter><section><title>
en: How do I install a source package?
zh_CN: 如何安装源码包？

note: type: Content of: <chapter><section><para>
en: Debian source packages can't actually be "installed", they are just unpacked in whatever directory you want to build the binary packages they produce.
zh_CN: 事实上，无法真正地“安装”Debian 源码包，它们仅仅是被解压到了您指定的目录，用于构建它们可以产生的二进制包。

note: type: Content of: <chapter><section><para>
en: Source packages are distributed on most of the same mirrors where you can obtain the binary packages.  If you set up your APT's <citerefentry><refentrytitle>sources.list</refentrytitle><manvolnum>5</manvolnum></citerefentry> to include the appropriate "deb-src" lines, you'll be able to easily download any source package by running
zh_CN: 绝大多数分发二进制包的镜像站也同时分发源码包。如果您已经修改了 APT 的 <citerefentry><refentrytitle>sources.list</refentrytitle><manvolnum>5</manvolnum></citerefentry> 并加入了适当的“deb-src”条目的话，您可以运行以下命令轻松下载任何源码包：

note: type: Content of: <chapter><section><para>
en: To help you in actually building the source package, Debian source packages provide the so-called build-dependencies mechanism.  This means that the source package maintainer keeps a list of other packages that are required to build their package.  To see how this is useful, run
zh_CN: 为了帮助您构建源码包，Debian 源码包提供了所谓的“编译依赖（build-dependency）”机制。这意味着源码包的维护者维护了一个构建该软件包所必需的其他软件包的列表。您可以在编译源码包之前执行

note: type: Content of: <chapter><section><para>
en: before building the source.
zh_CN: 来看看它有多实用。

note: type: Content of: <chapter><section><title>
en: How do I build binary packages from a source package?
zh_CN: 如何从源码包构建二进制包？

note: type: Content of: <chapter><section><para>
en: The preferred way to do this is by using various wrapper tools.  We'll show how it's done using the <literal>devscripts</literal> tools.  Install this package if you haven't done so already.
zh_CN: 推荐的方式是使用各种包装器工具。我们将用 <literal>devscripts</literal> 工具来演示如何操作。如果您还没有安装它的话，请安装该软件包。

note: type: Content of: <chapter><section><para>
en: Now, first get the source package:
zh_CN: 首先获取源码包：

note: type: Content of: <chapter><section><para>
en: and change to the source tree:
zh_CN: 并 cd 到源码树中：

note: type: Content of: <chapter><section><para>
en: Then install needed build-dependencies (if any):
zh_CN: 然后安装所需的编译依赖（如果有的话）：

note: type: Content of: <chapter><section><para>
en: Then create a dedicated version of your own build (so that you won't get confused later when Debian itself releases a new version):
zh_CN: 然后为您构建的版本指定一个独一无二的版本号（这样当 Debian 发布一个新版本时，您就不会感到混乱）：

note: type: Content of: <chapter><section><para>
en: And finally build your package:
zh_CN: 最后构建您的软件包：

note: type: Content of: <chapter><section><para>
en: If everything worked out fine, you should now be able to install your package by running
zh_CN: 如果一切顺利的话，您可以执行以下命令安装您的软件包：

note: type: Content of: <chapter><section><para>
en: If you prefer to do things manually, and don't want to use <literal>devscripts</literal>, follow this procedure:
zh_CN: 如果您喜欢手动操作，而不想使用 <literal>devscripts</literal>，请遵循以下步骤：

note: type: Content of: <chapter><section><para>
en: You will need all of foo_*.dsc, foo_*.tar.gz and foo_*.debian.tar.xz to compile the source (note: there is no .debian.tar.xz for some packages that are native to Debian).
zh_CN: 您需要准备好 foo_*.dsc、foo_*.tar.gz 以及 foo_*.debian.tar.xz 才能编译源码（注意：有些 Debian 原生的软件包没有 .debian.tar.xz 文件）。

note: type: Content of: <chapter><section><para>
en: Once you have them (<xref linkend="sourcepkgs"/>) and if you have the <systemitem role="package">dpkg-dev</systemitem> package installed, the following command:
zh_CN: 准备好以上文件（<xref linkend="sourcepkgs"/>）且安装 <systemitem role="package">dpkg-dev</systemitem> 软件包之后，执行以下命令：

note: type: Content of: <chapter><section><screen>
en: dpkg-source -x foo_version-revision.dsc
zh_CN: dpkg-source -x foo_版本号-修订版本号.dsc

note: type: Content of: <chapter><section><para>
en: will extract the package into a directory called <literal>foo-version</literal>.
zh_CN: 这会将源码包解压到一个名为 <literal>foo-版本号</literal> 的目录。

note: type: Content of: <chapter><section><para>
en: If you just want to compile the package, you may cd into the <literal>foo-version</literal> directory and issue the command
zh_CN: 如果您只想编译软件包，您可以 cd 到 <literal>foo-版本号</literal> 目录，然后执行

note: type: Content of: <chapter><section><para>
en: to build the package (note that this also requires the <systemitem role="package">fakeroot</systemitem> package), and then
zh_CN: 以编译源码包（注意该命令需要 <systemitem role="package">fakeroot</systemitem> 软件包），然后执行

note: type: Content of: <chapter><section><para>
en: to install the newly-built package(s).
zh_CN: 以安装刚编译好的软件包。

note: type: Content of: <chapter><section><title>
en: How do I create Debian packages myself?
zh_CN: 我应该如何创建自己的 Debian 软件包？

note: type: Content of: <chapter><section><para>
en: For a more detailed description on this, read the New Maintainers' Guide, available in the <systemitem role="package">maint-guide</systemitem> package or at <ulink url="https://www.debian.org/doc/devel-manuals#maint-guide"/>, or the Guide for Debian Maintainers, available in the <systemitem role="package">debmake-doc</systemitem> package or at <ulink url="https://www.debian.org/doc/devel-manuals#debmake-doc"/>.
zh_CN: 欲了解关于这一问题的详细信息，请阅读新维护者指南，可在 <systemitem role="package">maint-guide</systemitem> 软件包或 <ulink url="https://www.debian.org/doc/devel-manuals#maint-guide"/> 找到，或者 Debian 维护者指南，可在 <systemitem role="package">debmake-doc</systemitem> 软件包或 <ulink url="https://www.debian.org/doc/devel-manuals#debmake-doc"/> 找到。
