apt.conf.5.xml 19 KB

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