apt.conf.5.xml 20 KB

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