apt.conf.5.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. <?xml version="1.0" encoding="utf-8" standalone="no"?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  4. <!ENTITY % aptent SYSTEM "apt.ent">
  5. %aptent;
  6. ]>
  7. <refentry>
  8. <refentryinfo>
  9. &apt-author.jgunthorpe;
  10. &apt-author.team;
  11. &apt-email;
  12. &apt-product;
  13. <!-- The last update date -->
  14. <date>29 February 2004</date>
  15. </refentryinfo>
  16. <refmeta>
  17. <refentrytitle>apt.conf</refentrytitle>
  18. <manvolnum>5</manvolnum>
  19. </refmeta>
  20. <!-- Man page title -->
  21. <refnamediv>
  22. <refname>apt.conf</refname>
  23. <refpurpose>Configuration file for APT</refpurpose>
  24. </refnamediv>
  25. <refsect1><title>Description</title>
  26. <para><filename>apt.conf</filename> is the main configuration file for the APT suite of
  27. tools, all tools make use of the configuration file and a common command line
  28. parser to provide a uniform environment. When an APT tool starts up it will
  29. read the configuration specified by the <envar>APT_CONFIG</envar> environment
  30. variable (if any) and then read the files in <literal>Dir::Etc::Parts</literal>
  31. then read the main configuration file specified by
  32. <literal>Dir::Etc::main</literal> then finally apply the
  33. command line options to override the configuration directives, possibly
  34. loading even more config files.</para>
  35. <para>The configuration file is organized in a tree with options organized into
  36. functional groups. option specification is given with a double colon
  37. notation, for instance <literal>APT::Get::Assume-Yes</literal> is an option within
  38. the APT tool group, for the Get tool. options do not inherit from their
  39. parent groups.</para>
  40. <para>Syntacticly the configuration language is modeled after what the ISC tools
  41. such as bind and dhcp use. Lines starting with
  42. <literal>//</literal> are treated as comments (ignored).
  43. Each line is of the form
  44. <literal>APT::Get::Assume-Yes "true";</literal> The trailing
  45. semicolon is required and the quotes are optional. A new scope can be
  46. opened with curly braces, like:</para>
  47. <informalexample><programlisting>
  48. APT {
  49. Get {
  50. Assume-Yes "true";
  51. Fix-Broken "true";
  52. };
  53. };
  54. </programlisting></informalexample>
  55. <para>with newlines placed to make it more readable. Lists can be created by
  56. opening a scope and including a single word enclosed in quotes followed by a
  57. semicolon. Multiple entries can be included, each separated by a semicolon.</para>
  58. <informalexample><programlisting>
  59. DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
  60. </programlisting></informalexample>
  61. <para>In general the sample configuration file in
  62. <filename>&docdir;examples/apt.conf</filename> &configureindex;
  63. is a good guide for how it should look.</para>
  64. <para>Two specials are allowed, <literal>#include</literal> and <literal>#clear</literal>
  65. <literal>#include</literal> will include the given file, unless the filename
  66. ends in a slash, then the whole directory is included.
  67. <literal>#clear</literal> is used to erase a list of names.</para>
  68. <para>All of the APT tools take a -o option which allows an arbitrary configuration
  69. directive to be specified on the command line. The syntax is a full option
  70. name (<literal>APT::Get::Assume-Yes</literal> for instance) followed by an equals
  71. sign then the new value of the option. Lists can be appended too by adding
  72. a trailing :: to the list name.</para>
  73. </refsect1>
  74. <refsect1><title>The APT Group</title>
  75. <para>This group of options controls general APT behavior as well as holding the
  76. options for all of the tools.</para>
  77. <variablelist>
  78. <varlistentry><term>Architecture</term>
  79. <listitem><para>System Architecture; sets the architecture to use when fetching files and
  80. parsing package lists. The internal default is the architecture apt was
  81. compiled for.</para></listitem>
  82. </varlistentry>
  83. <varlistentry><term>Ignore-Hold</term>
  84. <listitem><para>Ignore Held packages; This global option causes the problem resolver to
  85. ignore held packages in its decision making.</para></listitem>
  86. </varlistentry>
  87. <varlistentry><term>Clean-Installed</term>
  88. <listitem><para>Defaults to on. When turned on the autoclean feature will remove any packages
  89. which can no longer be downloaded from the cache. If turned off then
  90. packages that are locally installed are also excluded from cleaning - but
  91. note that APT provides no direct means to reinstall them.</para></listitem>
  92. </varlistentry>
  93. <varlistentry><term>Immediate-Configure</term>
  94. <listitem><para>Disable Immediate Configuration; This dangerous option disables some
  95. of APT's ordering code to cause it to make fewer dpkg calls. Doing
  96. so may be necessary on some extremely slow single user systems but
  97. is very dangerous and may cause package install scripts to fail or worse.
  98. Use at your own risk.</para></listitem>
  99. </varlistentry>
  100. <varlistentry><term>Force-LoopBreak</term>
  101. <listitem><para>Never Enable this option unless you -really- know what you are doing. It
  102. permits APT to temporarily remove an essential package to break a
  103. Conflicts/Conflicts or Conflicts/Pre-Depend loop between two essential
  104. packages. SUCH A LOOP SHOULD NEVER EXIST AND IS A GRAVE BUG. This option
  105. will work if the essential packages are not tar, gzip, libc, dpkg, bash or
  106. anything that those packages depend on.</para></listitem>
  107. </varlistentry>
  108. <varlistentry><term>Cache-Limit</term>
  109. <listitem><para>APT uses a fixed size memory mapped cache file to store the 'available'
  110. information. This sets the size of that cache (in bytes).</para></listitem>
  111. </varlistentry>
  112. <varlistentry><term>Build-Essential</term>
  113. <listitem><para>Defines which package(s) are considered essential build dependencies.</para></listitem>
  114. </varlistentry>
  115. <varlistentry><term>Get</term>
  116. <listitem><para>The Get subsection controls the &apt-get; tool, please see its
  117. documentation for more information about the options here.</para></listitem>
  118. </varlistentry>
  119. <varlistentry><term>Cache</term>
  120. <listitem><para>The Cache subsection controls the &apt-cache; tool, please see its
  121. documentation for more information about the options here.</para></listitem>
  122. </varlistentry>
  123. <varlistentry><term>CDROM</term>
  124. <listitem><para>The CDROM subsection controls the &apt-cdrom; tool, please see its
  125. documentation for more information about the options here.</para></listitem>
  126. </varlistentry>
  127. </variablelist>
  128. </refsect1>
  129. <refsect1><title>The Acquire Group</title>
  130. <para>The <literal>Acquire</literal> group of options controls the download of packages
  131. and the URI handlers.
  132. <variablelist>
  133. <varlistentry><term>Queue-Mode</term>
  134. <listitem><para>Queuing mode; <literal>Queue-Mode</literal> can be one of <literal>host</literal> or
  135. <literal>access</literal> which determines how APT parallelizes outgoing
  136. connections. <literal>host</literal> means that one connection per target host
  137. will be opened, <literal>access</literal> means that one connection per URI type
  138. will be opened.</para></listitem>
  139. </varlistentry>
  140. <varlistentry><term>Retries</term>
  141. <listitem><para>Number of retries to perform. If this is non-zero APT will retry failed
  142. files the given number of times.</para></listitem>
  143. </varlistentry>
  144. <varlistentry><term>Source-Symlinks</term>
  145. <listitem><para>Use symlinks for source archives. If set to true then source archives will
  146. be symlinked when possible instead of copying. True is the default.</para></listitem>
  147. </varlistentry>
  148. <varlistentry><term>http</term>
  149. <listitem><para>HTTP URIs; http::Proxy is the default http proxy to use. It is in the
  150. standard form of <literal>http://[[user][:pass]@]host[:port]/</literal>. Per
  151. host proxies can also be specified by using the form
  152. <literal>http::Proxy::&lt;host&gt;</literal> with the special keyword <literal>DIRECT</literal>
  153. meaning to use no proxies. The <envar>http_proxy</envar> environment variable
  154. will override all settings.</para>
  155. <para>Three settings are provided for cache control with HTTP/1.1 compliant
  156. proxy caches. <literal>No-Cache</literal> tells the proxy to not use its cached
  157. response under any circumstances, <literal>Max-Age</literal> is sent only for
  158. index files and tells the cache to refresh its object if it is older than
  159. the given number of seconds. Debian updates its index files daily so the
  160. default is 1 day. <literal>No-Store</literal> specifies that the cache should never
  161. store this request, it is only set for archive files. This may be useful
  162. to prevent polluting a proxy cache with very large .deb files. Note:
  163. Squid 2.0.2 does not support any of these options.</para>
  164. <para>The option <literal>timeout</literal> sets the timeout timer used by the method,
  165. this applies to all things including connection timeout and data timeout.</para>
  166. <para>One setting is provided to control the pipeline depth in cases where the
  167. remote server is not RFC conforming or buggy (such as Squid 2.0.2)
  168. <literal>Acquire::http::Pipeline-Depth</literal> can be a value from 0 to 5
  169. indicating how many outstanding requests APT should send. A value of
  170. zero MUST be specified if the remote host does not properly linger
  171. on TCP connections - otherwise data corruption will occur. Hosts which
  172. require this are in violation of RFC 2068.</para></listitem>
  173. </varlistentry>
  174. <varlistentry><term>ftp</term>
  175. <listitem><para>FTP URIs; ftp::Proxy is the default proxy server to use. It is in the
  176. standard form of <literal>ftp://[[user][:pass]@]host[:port]/</literal> and is
  177. overridden by the <envar>ftp_proxy</envar> environment variable. To use a ftp
  178. proxy you will have to set the <literal>ftp::ProxyLogin</literal> script in the
  179. configuration file. This entry specifies the commands to send to tell
  180. the proxy server what to connect to. Please see
  181. &configureindex; for an example of
  182. how to do this. The subsitution variables available are
  183. <literal>$(PROXY_USER)</literal> <literal>$(PROXY_PASS)</literal> <literal>$(SITE_USER)</literal>
  184. <literal>$(SITE_PASS)</literal> <literal>$(SITE)</literal> and <literal>$(SITE_PORT)</literal>
  185. Each is taken from it's respective URI component.</para>
  186. <para>The option <literal>timeout</literal> sets the timeout timer used by the method,
  187. this applies to all things including connection timeout and data timeout.</para>
  188. <para>Several settings are provided to control passive mode. Generally it is
  189. safe to leave passive mode on, it works in nearly every environment.
  190. However some situations require that passive mode be disabled and port
  191. mode ftp used instead. This can be done globally, for connections that
  192. go through a proxy or for a specific host (See the sample config file
  193. for examples).</para>
  194. <para>It is possible to proxy FTP over HTTP by setting the <envar>ftp_proxy</envar>
  195. environment variable to a http url - see the discussion of the http method
  196. above for syntax. You cannot set this in the configuration file and it is
  197. not recommended to use FTP over HTTP due to its low efficiency.</para>
  198. <para>The setting <literal>ForceExtended</literal> controls the use of RFC2428
  199. <literal>EPSV</literal> and <literal>EPRT</literal> commands. The defaut is false, which means
  200. these commands are only used if the control connection is IPv6. Setting this
  201. to true forces their use even on IPv4 connections. Note that most FTP servers
  202. do not support RFC2428.</para></listitem>
  203. </varlistentry>
  204. <varlistentry><term>cdrom</term>
  205. <listitem><para>CDROM URIs; the only setting for CDROM URIs is the mount point,
  206. <literal>cdrom::Mount</literal> which must be the mount point for the CDROM drive
  207. as specified in <filename>/etc/fstab</filename>. It is possible to provide
  208. alternate mount and unmount commands if your mount point cannot be listed
  209. in the fstab (such as an SMB mount and old mount packages). The syntax
  210. is to put <literallayout>"/cdrom/"::Mount "foo";</literallayout> within
  211. the cdrom block. It is important to have the trailing slash. Unmount
  212. commands can be specified using UMount.</para></listitem>
  213. </varlistentry>
  214. </variablelist>
  215. </para>
  216. </refsect1>
  217. <refsect1><title>Directories</title>
  218. <para>The <literal>Dir::State</literal> section has directories that pertain to local
  219. state information. <literal>lists</literal> is the directory to place downloaded
  220. package lists in and <literal>status</literal> is the name of the dpkg status file.
  221. <literal>preferences</literal> is the name of the APT preferences file.
  222. <literal>Dir::State</literal> contains the default directory to prefix on all sub
  223. items if they do not start with <filename>/</filename> or <filename>./</filename>.</para>
  224. <para><literal>Dir::Cache</literal> contains locations pertaining to local cache
  225. information, such as the two package caches <literal>srcpkgcache</literal> and
  226. <literal>pkgcache</literal> as well as the location to place downloaded archives,
  227. <literal>Dir::Cache::archives</literal>. Generation of caches can be turned off
  228. by setting their names to be blank. This will slow down startup but
  229. save disk space. It is probably prefered to turn off the pkgcache rather
  230. than the srcpkgcache. Like <literal>Dir::State</literal> the default
  231. directory is contained in <literal>Dir::Cache</literal></para>
  232. <para><literal>Dir::Etc</literal> contains the location of configuration files,
  233. <literal>sourcelist</literal> gives the location of the sourcelist and
  234. <literal>main</literal> is the default configuration file (setting has no effect,
  235. unless it is done from the config file specified by
  236. <envar>APT_CONFIG</envar>.</para>
  237. <para>The <literal>Dir::Parts</literal> setting reads in all the config fragments in
  238. lexical order from the directory specified. After this is done then the
  239. main config file is loaded.</para>
  240. <para>Binary programs are pointed to by <literal>Dir::Bin</literal>. <literal>Dir::Bin::Methods</literal>
  241. specifies the location of the method handlers and <literal>gzip</literal>,
  242. <literal>dpkg</literal>, <literal>apt-get</literal> <literal>dpkg-source</literal>
  243. <literal>dpkg-buildpackage</literal> and <literal>apt-cache</literal> specify the location
  244. of the respective programs.</para>
  245. </refsect1>
  246. <refsect1><title>APT in DSelect</title>
  247. <para>
  248. When APT is used as a &dselect; method several configuration directives
  249. control the default behaviour. These are in the <literal>DSelect</literal> section.</para>
  250. <variablelist>
  251. <varlistentry><term>Clean</term>
  252. <listitem><para>Cache Clean mode; this value may be one of always, prompt, auto,
  253. pre-auto and never. always and prompt will remove all packages from
  254. the cache after upgrading, prompt (the default) does so conditionally.
  255. auto removes only those packages which are no longer downloadable
  256. (replaced with a new version for instance). pre-auto performs this
  257. action before downloading new packages.</para></listitem>
  258. </varlistentry>
  259. <varlistentry><term>options</term>
  260. <listitem><para>The contents of this variable is passed to &apt-get; as command line
  261. options when it is run for the install phase.</para></listitem>
  262. </varlistentry>
  263. <varlistentry><term>Updateoptions</term>
  264. <listitem><para>The contents of this variable is passed to &apt-get; as command line
  265. options when it is run for the update phase.</para></listitem>
  266. </varlistentry>
  267. <varlistentry><term>PromptAfterUpdate</term>
  268. <listitem><para>If true the [U]pdate operation in &dselect; will always prompt to continue.
  269. The default is to prompt only on error.</para></listitem>
  270. </varlistentry>
  271. </variablelist>
  272. </refsect1>
  273. <refsect1><title>How APT calls dpkg</title>
  274. <para>Several configuration directives control how APT invokes &dpkg;. These are
  275. in the <literal>DPkg</literal> section.</para>
  276. <variablelist>
  277. <varlistentry><term>options</term>
  278. <listitem><para>This is a list of options to pass to dpkg. The options must be specified
  279. using the list notation and each list item is passed as a single argument
  280. to &dpkg;.</para></listitem>
  281. </varlistentry>
  282. <varlistentry><term>Pre-Invoke</term><term>Post-Invoke</term>
  283. <listitem><para>This is a list of shell commands to run before/after invoking &dpkg;.
  284. Like <literal>options</literal> this must be specified in list notation. The
  285. commands are invoked in order using <filename>/bin/sh</filename>, should any
  286. fail APT will abort.</para></listitem>
  287. </varlistentry>
  288. <varlistentry><term>Pre-Install-Pkgs</term>
  289. <listitem><para>This is a list of shell commands to run before invoking dpkg. Like
  290. <literal>options</literal> this must be specified in list notation. The commands
  291. are invoked in order using <filename>/bin/sh</filename>, should any fail APT
  292. will abort. APT will pass to the commands on standard input the
  293. filenames of all .deb files it is going to install, one per line.</para>
  294. <para>Version 2 of this protocol dumps more information, including the
  295. protocol version, the APT configuration space and the packages, files
  296. and versions being changed. Version 2 is enabled by setting
  297. <literal>DPkg::Tools::options::cmd::Version</literal> to 2. <literal>cmd</literal> is a
  298. command given to <literal>Pre-Install-Pkgs</literal>.</para></listitem>
  299. </varlistentry>
  300. <varlistentry><term>Run-Directory</term>
  301. <listitem><para>APT chdirs to this directory before invoking dpkg, the default is
  302. <filename>/</filename>.</para></listitem>
  303. </varlistentry>
  304. <varlistentry><term>Build-options</term>
  305. <listitem><para>These options are passed to &dpkg-buildpackage; when compiling packages,
  306. the default is to disable signing and produce all binaries.</para></listitem>
  307. </varlistentry>
  308. </variablelist>
  309. </refsect1>
  310. <refsect1><title>Debug options</title>
  311. <para>Most of the options in the <literal>debug</literal> section are not interesting to
  312. the normal user, however <literal>Debug::pkgProblemResolver</literal> shows
  313. interesting output about the decisions dist-upgrade makes.
  314. <literal>Debug::NoLocking</literal> disables file locking so APT can do some
  315. operations as non-root and <literal>Debug::pkgDPkgPM</literal> will print out the
  316. command line for each dpkg invokation. <literal>Debug::IdentCdrom</literal> will
  317. disable the inclusion of statfs data in CDROM IDs.</para>
  318. </refsect1>
  319. <refsect1><title>Examples</title>
  320. <para>&configureindex; is a
  321. configuration file showing example values for all possible
  322. options.</para>
  323. </refsect1>
  324. <refsect1><title>Files</title>
  325. <para><filename>/etc/apt/apt.conf</filename></para>
  326. </refsect1>
  327. <refsect1><title>See Also</title>
  328. <para>&apt-cache;, &apt-config;<!-- ? reading apt.conf -->, &apt-preferences;.</para>
  329. </refsect1>
  330. &manbugs;
  331. </refentry>