apt.conf.5.xml 22 KB

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