pkgmgt.po 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. msgid ""
  2. msgstr ""
  3. "Project-Id-Version: PACKAGE VERSION\n"
  4. "POT-Creation-Date: 2020-06-17 12:44+0800\n"
  5. "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  6. "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  7. "Language-Team: LANGUAGE <LL@li.org>\n"
  8. "Language: zh_CN\n"
  9. "MIME-Version: 1.0\n"
  10. "Content-Type: text/plain; charset=UTF-8\n"
  11. "Content-Transfer-Encoding: 8bit\n"
  12. "X-Generator: Translate Toolkit 2.2.5\n"
  13. #. type: Content of: <sect1><title>
  14. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:11
  15. msgid "Package Management"
  16. msgstr "软件包管理"
  17. #. type: Content of: <sect1><para>
  18. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:13
  19. msgid ""
  20. "Package Management is an often requested addition to the LFS Book. A Package "
  21. "Manager allows tracking the installation of files making it easy to remove "
  22. "and upgrade packages. As well as the binary and library files, a package "
  23. "manager will handle the installation of configuration files. Before you "
  24. "begin to wonder, NO&mdash;this section will not talk about nor recommend any "
  25. "particular package manager. What it provides is a roundup of the more "
  26. "popular techniques and how they work. The perfect package manager for you "
  27. "may be among these techniques or may be a combination of two or more of "
  28. "these techniques. This section briefly mentions issues that may arise when "
  29. "upgrading packages."
  30. msgstr ""
  31. "经常有人请求将软件包管理加入 LFS 手册。包管理器可以跟踪文件的安装过程,简化移"
  32. "除或升级软件包的工作。如同处理二进制程序和库文件一样,包管理器也会处理配置文"
  33. "件的安装过程。在您开始想入非非前,不 —— 本节不会讨论或者推荐任何一个特定的"
  34. "包管理器。本节对软件包管理的流行技术及其工作原理进行综述。对您来说,完美的包"
  35. "管理器可能是其中的某个技术,也可能是几个技术的结合。本节还会简要介绍在升级软"
  36. "件包时可能遇到的问题。"
  37. #. type: Content of: <sect1><para>
  38. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:24
  39. msgid ""
  40. "Some reasons why no package manager is mentioned in LFS or BLFS include:"
  41. msgstr "LFS 或 BLFS 不介绍任何包管理器的原因包括:"
  42. #. type: Content of: <sect1><itemizedlist><listitem><para>
  43. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:29
  44. msgid ""
  45. "Dealing with package management takes the focus away from the goals of these "
  46. "books&mdash;teaching how a Linux system is built."
  47. msgstr "处理软件包管理会偏离这两本手册的目标 —— 讲述如何构建 Linux 系统。"
  48. #. type: Content of: <sect1><itemizedlist><listitem><para>
  49. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:34
  50. msgid ""
  51. "There are multiple solutions for package management, each having its "
  52. "strengths and drawbacks. Including one that satisfies all audiences is "
  53. "difficult."
  54. msgstr ""
  55. "存在多种软件包管理的解决方案,它们各有优缺点。很难找到一种让所有读者满意的"
  56. "方案。"
  57. #. type: Content of: <sect1><para>
  58. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:40
  59. msgid ""
  60. "There are some hints written on the topic of package management. Visit the "
  61. "<ulink url=\"&hints-index;\">Hints Project</ulink> and see if one of them "
  62. "fits your need."
  63. msgstr ""
  64. "已经有人写了一些关于软件包管理这一主题的短文。您可以访问 <ulink url=\"&hints-"
  65. "index;\">Hints Project</ulink> 并看一看是否有符合您的需求的方案。"
  66. #. type: Content of: <sect1><sect2><title>
  67. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:45
  68. msgid "Upgrade Issues"
  69. msgstr "升级问题"
  70. #. type: Content of: <sect1><sect2><para>
  71. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:47
  72. msgid ""
  73. "A Package Manager makes it easy to upgrade to newer versions when they are "
  74. "released. Generally the instructions in the LFS and BLFS books can be used "
  75. "to upgrade to the newer versions. Here are some points that you should be "
  76. "aware of when upgrading packages, especially on a running system."
  77. msgstr ""
  78. "使用包管理器可以在软件包新版本发布后容易地完成升级。一般来说,使用 LFS 或者 "
  79. "BLFS 手册给出的构建方法即可升级软件包。下面是您在升级时必须注意的重点,特别是升级正"
  80. "在运行的系统时。"
  81. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  82. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:54
  83. msgid ""
  84. "If Glibc needs to be upgraded to a newer version, (e.g. from glibc-2.31 to "
  85. "glibc-2.32), it is safer to rebuild LFS. Though you <emphasis>may</"
  86. "emphasis> be able to rebuild all the packages in their dependency order, we "
  87. "do not recommend it."
  88. msgstr ""
  89. "如果需要升级 Glibc (例如从 Glibc-2.31 升级到 Glibc-2.32),最安全的方法是重新"
  90. "构建 LFS。尽管您<emphasis>或许</emphasis>能按依赖顺序重新构建所有软件"
  91. "包,但我们不推荐这样做。"
  92. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  93. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:60
  94. msgid ""
  95. "If a package containing a shared library is updated, and if the name of the "
  96. "library changes, then any the packages dynamically linked to the library "
  97. "need to be recompiled in order to link against the newer library. (Note "
  98. "that there is no correlation between the package version and the name of the "
  99. "library.) For example, consider a package foo-1.2.3 that installs a shared "
  100. "library with name <filename class='libraryfile'>libfoo.so.1</filename>. If "
  101. "you upgrade the package to a newer version foo-1.2.4 that installs a shared "
  102. "library with name <filename class='libraryfile'>libfoo.so.2</filename>. In "
  103. "this case, any packages that are dynamically linked to <filename "
  104. "class='libraryfile'>libfoo.so.1</filename> need to be recompiled to link "
  105. "against <filename class='libraryfile'>libfoo.so.2</filename> in order to use "
  106. "the new library version. You should not remove the previous libraries unless "
  107. "all the dependent packages are recompiled."
  108. msgstr ""
  109. "如果更新了一个包含共享库的软件包,而且共享库的名称发生改变,那么所有动态链接"
  110. "到这个库的软件包都需要重新编译,以链接到新版本的库。(注意软件包的版本和共享"
  111. "库的名称没有关系。) 例如,考虑一个软件包 foo-1.2.3 安装了名为 <filename "
  112. "class='libraryfile'>libfoo.so.1</filename> 的共享库,如果您把该软件包升级到了新版"
  113. "本 foo-1.2.4,它安装了名为 <filename class='libraryfile'>libfoo.so.2</"
  114. "filename> 的共享库。那么,所有链接到 <filename class='libraryfile'>libfoo."
  115. "so.1</filename> 的软件包都要重新编译以链接到 <filename "
  116. "class='libraryfile'>libfoo.so.2</filename>。注意,您不能删除旧版本的库,"
  117. "直到将所有依赖它的软件包都重新编译完成。"
  118. #. type: Content of: <sect1><sect2><title>
  119. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:79
  120. msgid "Package Management Techniques"
  121. msgstr "软件包管理技术"
  122. #. type: Content of: <sect1><sect2><para>
  123. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:81
  124. msgid ""
  125. "The following are some common package management techniques. Before making a "
  126. "decision on a package manager, do some research on the various techniques, "
  127. "particularly the drawbacks of the particular scheme."
  128. msgstr ""
  129. "以下是几种常见的软件包管理技术。在决定使用某种包管理器前,请研读这些技术,特"
  130. "别是要了解特定技术的不足。"
  131. #. type: Content of: <sect1><sect2><sect3><title>
  132. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:86
  133. msgid "It is All in My Head!"
  134. msgstr "这都在我的脑袋里!"
  135. #. type: Content of: <sect1><sect2><sect3><para>
  136. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:88
  137. msgid ""
  138. "Yes, this is a package management technique. Some folks do not find the need "
  139. "for a package manager because they know the packages intimately and know "
  140. "what files are installed by each package. Some users also do not need any "
  141. "package management because they plan on rebuilding the entire system when a "
  142. "package is changed."
  143. msgstr ""
  144. "没错,这是一种包管理技术。有些人觉得不需要管理软件包,因为他们十分了解软件"
  145. "包,知道每个软件包安装了什么文件。有的用户则计划每次有软件包发生变动时就重新"
  146. "构建系统,所以不需要管理软件包。"
  147. #. type: Content of: <sect1><sect2><sect3><title>
  148. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:97
  149. msgid "Install in Separate Directories"
  150. msgstr "安装到独立目录"
  151. #. type: Content of: <sect1><sect2><sect3><para>
  152. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:99
  153. msgid ""
  154. "This is a simplistic package management that does not need any extra package "
  155. "to manage the installations. Each package is installed in a separate "
  156. "directory. For example, package foo-1.1 is installed in <filename "
  157. "class='directory'>/usr/pkg/foo-1.1</filename> and a symlink is made from "
  158. "<filename>/usr/pkg/foo</filename> to <filename class='directory'>/usr/pkg/"
  159. "foo-1.1</filename>. When installing a new version foo-1.2, it is installed "
  160. "in <filename class='directory'>/usr/pkg/foo-1.2</filename> and the previous "
  161. "symlink is replaced by a symlink to the new version."
  162. msgstr ""
  163. "这是一种最简单的软件包管理方式,它不需要任何额外的软件来控制软件包的安装。每"
  164. "个软件包都被安装在单独的目录中。例如,软件包 foo-1.1 将会被安装在 <filename "
  165. "class='directory'>/usr/pkg/foo-1.1</filename>,然后创建一个符号链接 "
  166. "<filename>/usr/pkg/foo</filename> 指向 <filename class='directory'>/usr/pkg/"
  167. "foo-1.1</filename>。在安装新版本 foo-1.2 的时候,把它安装到 <filename "
  168. "class='directory'>/usr/pkg/foo-1.2</filename>,然后把之前的符号链接替换为指"
  169. "向新版本的符号链接。"
  170. #. type: Content of: <sect1><sect2><sect3><para>
  171. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:109
  172. msgid ""
  173. "Environment variables such as <envar>PATH</envar>, <envar>LD_LIBRARY_PATH</"
  174. "envar>, <envar>MANPATH</envar>, <envar>INFOPATH</envar> and <envar>CPPFLAGS</"
  175. "envar> need to be expanded to include <filename>/usr/pkg/foo</filename>. For "
  176. "more than a few packages, this scheme becomes unmanageable."
  177. msgstr ""
  178. "<envar>PATH</envar>、<envar>LD_LIBRARY_PATH</envar>、<envar>MANPATH</"
  179. "envar>、<envar>INFOPATH</envar> 和 <envar>CPPFLAGS</envar> 等环境变量需要被扩"
  180. "充,以包含 <filename>/usr/pkg/foo</filename>。一旦软件包的数量较多,这种架构"
  181. "就会变得无法管理。"
  182. #. type: Content of: <sect1><sect2><sect3><title>
  183. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:118
  184. msgid "Symlink Style Package Management"
  185. msgstr "符号链接风格的软件包管理"
  186. #. type: Content of: <sect1><sect2><sect3><para>
  187. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:120
  188. msgid ""
  189. "This is a variation of the previous package management technique. Each "
  190. "package is installed similar to the previous scheme. But instead of making "
  191. "the symlink, each file is symlinked into the <filename class='directory'>/"
  192. "usr</filename> hierarchy. This removes the need to expand the environment "
  193. "variables. Though the symlinks can be created by the user to automate the "
  194. "creation, many package managers have been written using this approach. A few "
  195. "of the popular ones include Stow, Epkg, Graft, and Depot."
  196. msgstr ""
  197. "这是前一种软件包管理技术的变种。和前一种方式一样,将各个软件包同样安装在独"
  198. "立的目录中。但不是建立目录的符号链接,而是把其中的每个文件符号链接到 "
  199. "<filename class='directory'>/usr</filename> 目录树中对应的位置。这样就不需要"
  200. "修改环境变量。虽然这些符号链接可以由用户自己创建,但已经有许多包管理器能够自"
  201. "动化这一过程。一些流行的包管理器如 Stow、Epkg、Graft 和 Depot 使用这种管理方"
  202. "式。"
  203. #. type: Content of: <sect1><sect2><sect3><para>
  204. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:129
  205. msgid ""
  206. "The installation needs to be faked, so that the package thinks that it is "
  207. "installed in <filename class=\"directory\">/usr</filename> though in reality "
  208. "it is installed in the <filename class=\"directory\">/usr/pkg</filename> "
  209. "hierarchy. Installing in this manner is not usually a trivial task. For "
  210. "example, consider that you are installing a package libfoo-1.1. The "
  211. "following instructions may not install the package properly:"
  212. msgstr ""
  213. "安装过程需要伪装,使得软件包认为它处于 <filename class=\"directory\">/usr</"
  214. "filename> 中,尽管它实际上被安装在 <filename class=\"directory\">/usr/pkg</"
  215. "filename> 目录结构中。这种安装过程一般是超出常规的。例如,考虑安装软件包 "
  216. "libfoo-1.1。下面的指令可能不能正确安装该软件包:"
  217. #. type: Content of: <sect1><sect2><sect3><screen>
  218. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:137
  219. #, no-wrap
  220. msgid ""
  221. "<userinput>./configure --prefix=/usr/pkg/libfoo/1.1\n"
  222. "make\n"
  223. "make install</userinput>"
  224. msgstr ""
  225. "<userinput>./configure --prefix=/usr/pkg/libfoo/1.1\n"
  226. "make\n"
  227. "make install</userinput>"
  228. #. type: Content of: <sect1><sect2><sect3><para>
  229. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:141
  230. msgid ""
  231. "The installation will work, but the dependent packages may not link to "
  232. "libfoo as you would expect. If you compile a package that links against "
  233. "libfoo, you may notice that it is linked to <filename class='libraryfile'>/"
  234. "usr/pkg/libfoo/1.1/lib/libfoo.so.1</filename> instead of <filename "
  235. "class='libraryfile'>/usr/lib/libfoo.so.1</filename> as you would expect. The "
  236. "correct approach is to use the <envar>DESTDIR</envar> strategy to fake "
  237. "installation of the package. This approach works as follows:"
  238. msgstr ""
  239. "尽管安装过程本身可以顺利进行,但依赖于它的软件包可能不会像您期望的那样链接 "
  240. "libfoo 库。如果要编译一个依赖于 libfoo 的软件包,您可能发现它链接到了 "
  241. "<filename class='libraryfile'>/usr/pkg/libfoo/1.1/lib/libfoo.so.1</filename> "
  242. "而不是您期望的 <filename class='libraryfile'>/usr/lib/libfoo.so.1</"
  243. "filename>。正确的做法是使用 <envar>DESTDIR</envar> 策略伪装软件包的安装过"
  244. "程。就像下面这样做:"
  245. #. type: Content of: <sect1><sect2><sect3><screen>
  246. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:150
  247. #, no-wrap
  248. msgid ""
  249. "<userinput>./configure --prefix=/usr\n"
  250. "make\n"
  251. "make DESTDIR=/usr/pkg/libfoo/1.1 install</userinput>"
  252. msgstr ""
  253. "<userinput>./configure --prefix=/usr\n"
  254. "make\n"
  255. "make DESTDIR=/usr/pkg/libfoo/1.1 install</userinput>"
  256. #. type: Content of: <sect1><sect2><sect3><para>
  257. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:154
  258. msgid ""
  259. "Most packages support this approach, but there are some which do not. For "
  260. "the non-compliant packages, you may either need to manually install the "
  261. "package, or you may find that it is easier to install some problematic "
  262. "packages into <filename class='directory'>/opt</filename>."
  263. msgstr ""
  264. "多数软件包可以这样安装,但有些不能。对于那些不兼容的软件包,您要么亲自动手"
  265. "安装,要么更简单地把一些出问题的软件包安装在 <filename class='directory'>/"
  266. "opt</filename>中。"
  267. #. type: Content of: <sect1><sect2><sect3><title>
  268. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:162
  269. msgid "Timestamp Based"
  270. msgstr "基于时间戳的方案"
  271. #. type: Content of: <sect1><sect2><sect3><para>
  272. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:164
  273. msgid ""
  274. "In this technique, a file is timestamped before the installation of the "
  275. "package. After the installation, a simple use of the <command>find</command> "
  276. "command with the appropriate options can generate a log of all the files "
  277. "installed after the timestamp file was created. A package manager written "
  278. "with this approach is install-log."
  279. msgstr ""
  280. "在这种技巧中,安装一个软件包之前,为它创建一个时间戳文件。在安装后,用一行简"
  281. "单的 <command>find</command> 命令,加上正确的参数,就能生成安装日志,包含在时"
  282. "间戳文件创建以后安装的所有文件。有一个采用这个方案的包管理器叫做 install-"
  283. "log。"
  284. #. type: Content of: <sect1><sect2><sect3><para>
  285. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:170
  286. msgid ""
  287. "Though this scheme has the advantage of being simple, it has two drawbacks. "
  288. "If, during installation, the files are installed with any timestamp other "
  289. "than the current time, those files will not be tracked by the package "
  290. "manager. Also, this scheme can only be used when one package is installed at "
  291. "a time. The logs are not reliable if two packages are being installed on two "
  292. "different consoles."
  293. msgstr ""
  294. "尽管这种方式很简单,但它有两个缺点。如果在安装过程中,某些文件没有以当前时间"
  295. "作为时间戳安装,它们就不能被包管理器跟踪。另外,只有每次只安装一个软件包时才"
  296. "能使用这种技术。如果在两个终端中同时安装两个不同的软件包,它们的安装日志就不"
  297. "可靠了。"
  298. #. type: Content of: <sect1><sect2><sect3><title>
  299. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:180
  300. msgid "Tracing Installation Scripts"
  301. msgstr "追踪安装脚本"
  302. #. type: Content of: <sect1><sect2><sect3><para>
  303. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:182
  304. msgid ""
  305. "In this approach, the commands that the installation scripts perform are "
  306. "recorded. There are two techniques that one can use:"
  307. msgstr "在这种方式中,安装脚本执行的命令被记录下来。有两种技术可以进行记录:"
  308. #. type: Content of: <sect1><sect2><sect3><para>
  309. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:185
  310. msgid ""
  311. "The <envar>LD_PRELOAD</envar> environment variable can be set to point to a "
  312. "library to be preloaded before installation. During installation, this "
  313. "library tracks the packages that are being installed by attaching itself to "
  314. "various executables such as <command>cp</command>, <command>install</"
  315. "command>, <command>mv</command> and tracking the system calls that modify "
  316. "the filesystem. For this approach to work, all the executables need to be "
  317. "dynamically linked without the suid or sgid bit. Preloading the library may "
  318. "cause some unwanted side-effects during installation. Therefore, it is "
  319. "advised that one performs some tests to ensure that the package manager does "
  320. "not break anything and logs all the appropriate files."
  321. msgstr ""
  322. "在安装前设置 <envar>LD_PRELOAD</envar> 环境变量,将其指向一个库以在安装过程中"
  323. "预加载它。在安装过程中,这个库附加在 <command>cp</command>、"
  324. "<command>install</command>、<command>mv</command> 等可执行文件上,跟踪修改文"
  325. "件系统的系统调用。如果要使用这种方法,所有需要跟踪的可执行文件必须是动态链接"
  326. "的,且没有设定 suid 和 sgid 位。预加载动态库可能在安装过程中导致不希望的副"
  327. "作用。因此,建议在实际使用前进行一些测试,以确保包管理器不会造成破坏,并且记"
  328. "录了所有应该记录的文件。"
  329. #. type: Content of: <sect1><sect2><sect3><para>
  330. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:197
  331. msgid ""
  332. "The second technique is to use <command>strace</command>, which logs all "
  333. "system calls made during the execution of the installation scripts."
  334. msgstr ""
  335. "第二种技术是使用 <command>strace</command>,它能够记录安装脚本执行过程中的所"
  336. "有系统调用。"
  337. #. type: Content of: <sect1><sect2><sect3><title>
  338. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:203
  339. msgid "Creating Package Archives"
  340. msgstr "创建软件包档案"
  341. #. type: Content of: <sect1><sect2><sect3><para>
  342. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:205
  343. msgid ""
  344. "In this scheme, the package installation is faked into a separate tree as "
  345. "described in the Symlink style package management. After the installation, a "
  346. "package archive is created using the installed files. This archive is then "
  347. "used to install the package either on the local machine or can even be used "
  348. "to install the package on other machines."
  349. msgstr ""
  350. "在这种架构中,软件包被伪装安装到一个独立的目录树中,就像软链接风格的软件包管"
  351. "理那样。在安装后,使用被安装的文件创建一个软件包档案。它可以被用来在本地机"
  352. "器甚至其他机器上安装该软件包。"
  353. #. type: Content of: <sect1><sect2><sect3><para>
  354. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:211
  355. msgid ""
  356. "This approach is used by most of the package managers found in the "
  357. "commercial distributions. Examples of package managers that follow this "
  358. "approach are RPM (which, incidentally, is required by the <ulink url="
  359. "\"http://refspecs.linuxfoundation.org/lsb.shtml\">Linux Standard Base "
  360. "Specification</ulink>), pkg-utils, Debian's apt, and Gentoo's Portage "
  361. "system. A hint describing how to adopt this style of package management for "
  362. "LFS systems is located at <ulink url=\"&hints-root;fakeroot.txt\"/>."
  363. msgstr ""
  364. "大多数商业发行版的包管理器采用这种策略。例如 RPM (值得一提的是,它被 <ulink "
  365. "url=\"http://refspecs.linuxfoundation.org/lsb.shtml\">Linux Standard Base 规"
  366. "则</ulink>所要求)、pkg-utils、Debian 的 apt,以及 Gentoo 的 Portage 系统"
  367. "等。LFS Hint 中的一篇短文描述了如何为 LFS 系统适用这种管理方式:<ulink url="
  368. "\"&hints-root;fakeroot.txt\"/>。"
  369. #. type: Content of: <sect1><sect2><sect3><para>
  370. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:220
  371. msgid ""
  372. "Creation of package files that include dependency information is complex and "
  373. "is beyond the scope of LFS."
  374. msgstr "创建包含依赖关系信息的软件包文件十分复杂,超出了 LFS 的范畴。"
  375. #. type: Content of: <sect1><sect2><sect3><para>
  376. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:223
  377. msgid ""
  378. "Slackware uses a <command>tar</command> based system for package archives. "
  379. "This system purposely does not handle package dependencies as more complex "
  380. "package managers do. For details of Slackware package management, see "
  381. "<ulink url=\"http://www.slackbook.org/html/package-management.html\"/>."
  382. msgstr ""
  383. "Slackware 使用一个基于 <command>tar</command> 的系统创建软件包档案。和更复"
  384. "杂的包管理器不同,该系统有意地没有涉及软件包依赖关系。如果想了解 Slackware "
  385. "包管理器的详细信息,阅读 <ulink url=\"http://www.slackbook.org/html/package-"
  386. "management.html\"/>。"
  387. #. type: Content of: <sect1><sect2><sect3><title>
  388. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:231
  389. msgid "User Based Management"
  390. msgstr "基于用户的软件包管理"
  391. #. type: Content of: <sect1><sect2><sect3><para>
  392. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:233
  393. msgid ""
  394. "This scheme, unique to LFS, was devised by Matthias Benkmann, and is "
  395. "available from the <ulink url=\"&hints-index;\">Hints Project</ulink>. In "
  396. "this scheme, each package is installed as a separate user into the standard "
  397. "locations. Files belonging to a package are easily identified by checking "
  398. "the user ID. The features and shortcomings of this approach are too complex "
  399. "to describe in this section. For the details please see the hint at <ulink "
  400. "url=\"&hints-root;more_control_and_pkg_man.txt\"/>."
  401. msgstr ""
  402. "这种架构是 LFS 特有的,由 Matthias Benkmann 提出,可以在 <ulink url=\"&hints-"
  403. "index;\">Hints Project</ulink> 查阅。在该架构中,每个软件包都由一个单独的用户"
  404. "安装到标准位置。只要检查文件所有者,就能找出属于一个软件包的所有文件。它的优"
  405. "缺点十分复杂,无法在本节讨论。如果想详细了解,请访问 <ulink url=\"&hints-"
  406. "root;more_control_and_pkg_man.txt\"/> 阅读。"
  407. #. type: Content of: <sect1><sect2><title>
  408. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:246
  409. msgid "Deploying LFS on Multiple Systems"
  410. msgstr "在多个系统上部署 LFS"
  411. #. type: Content of: <sect1><sect2><para>
  412. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:248
  413. msgid ""
  414. "One of the advantages of an LFS system is that there are no files that "
  415. "depend on the position of files on a disk system. Cloning an LFS build to "
  416. "another computer with the same architecture as the base system is as simple "
  417. "as using <command>tar</command> on the LFS partition that contains the root "
  418. "directory (about 250MB uncompressed for a base LFS build), copying that file "
  419. "via network transfer or CD-ROM to the new system and expanding it. From "
  420. "that point, a few configuration files will have to be changed. "
  421. "Configuration files that may need to be updated include: <filename>/etc/"
  422. "hosts</filename>, <filename>/etc/fstab</filename>, <filename>/etc/passwd</"
  423. "filename>, <filename>/etc/group</filename>, <phrase revision=\"systemd\"> "
  424. "<filename>/etc/shadow</filename>, and <filename>/etc/ld.so.conf</filename>. "
  425. "</phrase> <phrase revision=\"sysv\"> <filename>/etc/shadow</filename>, "
  426. "<filename>/etc/ld.so.conf</filename>, <filename>/etc/sysconfig/rc.site</"
  427. "filename>, <filename>/etc/sysconfig/network</filename>, and <filename>/etc/"
  428. "sysconfig/ifconfig.eth0</filename>. </phrase>"
  429. msgstr ""
  430. "LFS 系统的一项优势是,没有依赖于磁盘系统中文件位置的文件。将构建好的 LFS 系"
  431. "统复制到另一台具有相同硬件架构的计算机很简单,只要用 <command>tar</command> "
  432. "命令把包含根目录的 LFS 分区打包 (未压缩的情况下,一个基本的 LFS 系统需要 250 "
  433. "MB),然后通过网络或者 CD-ROM 复制到新的系统上,再展开即可。这时,个别配置文"
  434. "件需要修改。可能需要更新的配置文件有:<filename>/etc/hosts</filename>,"
  435. "<filename>/etc/fstab</filename>,<filename>/etc/passwd</filename>,"
  436. "<filename>/etc/group</filename>,<phrase revision=\"systemd\"><filename>/"
  437. "etc/shadow</filename>,以及 <filename>/etc/ld.so.conf</filename>。</"
  438. "phrase><phrase revision=\"sysv\"><filename>/etc/shadow</filename>,"
  439. "<filename>/etc/ld.so.conf</filename>,<filename>/etc/sysconfig/rc.site</"
  440. "filename>,<filename>/etc/sysconfig/network</filename>,以及 <filename>/etc/"
  441. "sysconfig/ifconfig.eth0</filename>。</phrase>"
  442. #. type: Content of: <sect1><sect2><para>
  443. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:273
  444. msgid ""
  445. "A custom kernel may need to be built for the new system depending on "
  446. "differences in system hardware and the original kernel configuration."
  447. msgstr "由于系统硬件和原始内核配置的区别,可能需要为新系统重新配置并构建内核。"
  448. #. type: Content of: <sect1><sect2><note><para>
  449. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:277
  450. msgid ""
  451. "There have been some reports of issues when copying between similar but not "
  452. "identical architectures. For instance, the instruction set for an Intel "
  453. "system is not identical with an AMD processor and later versions of some "
  454. "processors may have instructions that are unavailable in earlier versions."
  455. msgstr ""
  456. "有一些报告反映称,在架构相近但不完全一致的计算机之间拷贝 LFS 系统时出现问题。"
  457. "例如,Intel 系统使用的指令集和 AMD 处理器不完全相同,且较新的处理器可能包含旧"
  458. "处理器没有的指令。"
  459. #. type: Content of: <sect1><sect2><para>
  460. #: /home/xry111/svn-repos/LFS-BOOK/chapter08/pkgmgt.xml:283
  461. msgid ""
  462. "Finally the new system has to be made bootable via <xref linkend=\"ch-"
  463. "bootable-grub\"/>."
  464. msgstr ""
  465. "最后,按照<xref linkend=\"ch-bootable-grub\"/>中的说明,为新系统配置引导加载"
  466. "器。"