apt.conf.5.xml 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998
  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. <author>
  12. <firstname>Daniel</firstname>
  13. <surname>Burrows</surname>
  14. <contrib>Initial documentation of Debug::*.</contrib>
  15. <email>dburrows@debian.org</email>
  16. </author>
  17. &apt-email;
  18. &apt-product;
  19. <!-- The last update date -->
  20. <date>18 September 2009</date>
  21. </refentryinfo>
  22. <refmeta>
  23. <refentrytitle>apt.conf</refentrytitle>
  24. <manvolnum>5</manvolnum>
  25. <refmiscinfo class="manual">APT</refmiscinfo>
  26. </refmeta>
  27. <!-- Man page title -->
  28. <refnamediv>
  29. <refname>apt.conf</refname>
  30. <refpurpose>Configuration file for APT</refpurpose>
  31. </refnamediv>
  32. <refsect1><title>Description</title>
  33. <para><filename>apt.conf</filename> is the main configuration file for the APT suite of
  34. tools, all tools make use of the configuration file and a common command line
  35. parser to provide a uniform environment. When an APT tool starts up it will
  36. read the configuration specified by the <envar>APT_CONFIG</envar> environment
  37. variable (if any) and then read the files in <literal>Dir::Etc::Parts</literal>
  38. then read the main configuration file specified by
  39. <literal>Dir::Etc::main</literal> then finally apply the
  40. command line options to override the configuration directives, possibly
  41. loading even more config files.</para>
  42. <para>The configuration file is organized in a tree with options organized into
  43. functional groups. option specification is given with a double colon
  44. notation, for instance <literal>APT::Get::Assume-Yes</literal> is an option within
  45. the APT tool group, for the Get tool. options do not inherit from their
  46. parent groups.</para>
  47. <para>Syntactically the configuration language is modeled after what the ISC tools
  48. such as bind and dhcp use. Lines starting with
  49. <literal>//</literal> are treated as comments (ignored), as well as all text
  50. between <literal>/*</literal> and <literal>*/</literal>, just like C/C++ comments.
  51. Each line is of the form
  52. <literal>APT::Get::Assume-Yes "true";</literal> The trailing
  53. semicolon and the quotes are required. The value must be on one line, and
  54. there is no kind of string concatenation. It must not include inside quotes.
  55. The behavior of the backslash "\" and escaped characters inside a value is
  56. undefined and it should not be used. An option name may include
  57. alphanumerical characters and the "/-:._+" characters. A new scope can
  58. be opened with curly braces, like:</para>
  59. <informalexample><programlisting>
  60. APT {
  61. Get {
  62. Assume-Yes "true";
  63. Fix-Broken "true";
  64. };
  65. };
  66. </programlisting></informalexample>
  67. <para>with newlines placed to make it more readable. Lists can be created by
  68. opening a scope and including a single string enclosed in quotes followed by a
  69. semicolon. Multiple entries can be included, each separated by a semicolon.</para>
  70. <informalexample><programlisting>
  71. DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
  72. </programlisting></informalexample>
  73. <para>In general the sample configuration file in
  74. <filename>&docdir;examples/apt.conf</filename> &configureindex;
  75. is a good guide for how it should look.</para>
  76. <para>The names of the configuration items are not case-sensitive. So in the previous example
  77. you could use <literal>dpkg::pre-install-pkgs</literal>.</para>
  78. <para>Names for the configuration items are optional if a list is defined as it can be see in
  79. the <literal>DPkg::Pre-Install-Pkgs</literal> example above. If you don't specify a name a
  80. new entry will simply add a new option to the list. If you specify a name you can override
  81. the option as every other option by reassigning a new value to the option.</para>
  82. <para>Two specials are allowed, <literal>#include</literal> (which is deprecated
  83. and not supported by alternative implementations) and <literal>#clear</literal>:
  84. <literal>#include</literal> will include the given file, unless the filename
  85. ends in a slash, then the whole directory is included.
  86. <literal>#clear</literal> is used to erase a part of the configuration tree. The
  87. specified element and all its descendants are erased.
  88. (Note that these lines also need to end with a semicolon.)</para>
  89. <para>The #clear command is the only way to delete a list or a complete scope.
  90. Reopening a scope or the ::-style described below will <emphasis>not</emphasis>
  91. override previously written entries. Only options can be overridden by addressing a new
  92. value to it - lists and scopes can't be overridden, only cleared.</para>
  93. <para>All of the APT tools take a -o option which allows an arbitrary configuration
  94. directive to be specified on the command line. The syntax is a full option
  95. name (<literal>APT::Get::Assume-Yes</literal> for instance) followed by an equals
  96. sign then the new value of the option. Lists can be appended too by adding
  97. a trailing :: to the list name. (As you might suspect: The scope syntax can't be used
  98. on the command line.)</para>
  99. <para>Note that you can use :: only for appending one item per line to a list and
  100. that you should not use it in combination with the scope syntax.
  101. (The scope syntax implicit insert ::) Using both syntaxes together will trigger a bug
  102. which some users unfortunately relay on: An option with the unusual name "<literal>::</literal>"
  103. which acts like every other option with a name. These introduces many problems
  104. including that a user who writes multiple lines in this <emphasis>wrong</emphasis> syntax in
  105. the hope to append to a list will gain the opposite as only the last assignment for this option
  106. "<literal>::</literal>" will be used. Upcoming APT versions will raise errors and
  107. will stop working if they encounter this misuse, so please correct such statements now
  108. as long as APT doesn't complain explicit about them.</para>
  109. </refsect1>
  110. <refsect1><title>The APT Group</title>
  111. <para>This group of options controls general APT behavior as well as holding the
  112. options for all of the tools.</para>
  113. <variablelist>
  114. <varlistentry><term>Architecture</term>
  115. <listitem><para>System Architecture; sets the architecture to use when fetching files and
  116. parsing package lists. The internal default is the architecture apt was
  117. compiled for.</para></listitem>
  118. </varlistentry>
  119. <varlistentry><term>Default-Release</term>
  120. <listitem><para>Default release to install packages from if more than one
  121. version available. Contains release name, codename or release version. Examples: 'stable', 'testing', 'unstable', 'lenny', 'squeeze', '4.0', '5.0*'. See also &apt-preferences;.</para></listitem>
  122. </varlistentry>
  123. <varlistentry><term>Ignore-Hold</term>
  124. <listitem><para>Ignore Held packages; This global option causes the problem resolver to
  125. ignore held packages in its decision making.</para></listitem>
  126. </varlistentry>
  127. <varlistentry><term>Clean-Installed</term>
  128. <listitem><para>Defaults to on. When turned on the autoclean feature will remove any packages
  129. which can no longer be downloaded from the cache. If turned off then
  130. packages that are locally installed are also excluded from cleaning - but
  131. note that APT provides no direct means to reinstall them.</para></listitem>
  132. </varlistentry>
  133. <varlistentry><term>Immediate-Configure</term>
  134. <listitem><para>Defaults to on which will cause APT to install essential and important packages
  135. as fast as possible in the install/upgrade operation. This is done to limit the effect of a failing
  136. &dpkg; call: If this option is disabled APT doesn't treat an important package in the same way as
  137. an extra package: Between the unpacking of the important package A and his configuration can then
  138. be many other unpack or configuration calls, e.g. for package B which has no relation to A, but
  139. causes the dpkg call to fail (e.g. because maintainer script of package B generates an error) which results
  140. in a system state in which package A is unpacked but unconfigured - each package depending on A is now no
  141. longer guaranteed to work as their dependency on A is not longer satisfied. The immediate configuration marker
  142. is also applied to all dependencies which can generate a problem if the dependencies e.g. form a circle
  143. as a dependency with the immediate flag is comparable with a Pre-Dependency. So in theory it is possible
  144. that APT encounters a situation in which it is unable to perform immediate configuration, error out and
  145. refers to this option so the user can deactivate the immediate configuration temporary to be able to perform
  146. an install/upgrade again. Note the use of the word "theory" here as this problem was only encountered by now
  147. in real world a few times in non-stable distribution versions and caused by wrong dependencies of the package
  148. in question, so you should not blindly disable this option as the mentioned scenario above is not the only
  149. problem immediate configuration can help to prevent in the first place.</para></listitem>
  150. </varlistentry>
  151. <varlistentry><term>Force-LoopBreak</term>
  152. <listitem><para>Never Enable this option unless you -really- know what you are doing. It
  153. permits APT to temporarily remove an essential package to break a
  154. Conflicts/Conflicts or Conflicts/Pre-Depend loop between two essential
  155. packages. SUCH A LOOP SHOULD NEVER EXIST AND IS A GRAVE BUG. This option
  156. will work if the essential packages are not tar, gzip, libc, dpkg, bash or
  157. anything that those packages depend on.</para></listitem>
  158. </varlistentry>
  159. <varlistentry><term>Cache-Limit</term>
  160. <listitem><para>APT uses a fixed size memory mapped cache file to store the 'available'
  161. information. This sets the size of that cache (in bytes).</para></listitem>
  162. </varlistentry>
  163. <varlistentry><term>Build-Essential</term>
  164. <listitem><para>Defines which package(s) are considered essential build dependencies.</para></listitem>
  165. </varlistentry>
  166. <varlistentry><term>Get</term>
  167. <listitem><para>The Get subsection controls the &apt-get; tool, please see its
  168. documentation for more information about the options here.</para></listitem>
  169. </varlistentry>
  170. <varlistentry><term>Cache</term>
  171. <listitem><para>The Cache subsection controls the &apt-cache; tool, please see its
  172. documentation for more information about the options here.</para></listitem>
  173. </varlistentry>
  174. <varlistentry><term>CDROM</term>
  175. <listitem><para>The CDROM subsection controls the &apt-cdrom; tool, please see its
  176. documentation for more information about the options here.</para></listitem>
  177. </varlistentry>
  178. </variablelist>
  179. </refsect1>
  180. <refsect1><title>The Acquire Group</title>
  181. <para>The <literal>Acquire</literal> group of options controls the download of packages
  182. and the URI handlers.
  183. <variablelist>
  184. <varlistentry><term>PDiffs</term>
  185. <listitem><para>Try to download deltas called <literal>PDiffs</literal> for
  186. Packages or Sources files instead of downloading whole ones. True
  187. by default.</para></listitem>
  188. </varlistentry>
  189. <varlistentry><term>Queue-Mode</term>
  190. <listitem><para>Queuing mode; <literal>Queue-Mode</literal> can be one of <literal>host</literal> or
  191. <literal>access</literal> which determines how APT parallelizes outgoing
  192. connections. <literal>host</literal> means that one connection per target host
  193. will be opened, <literal>access</literal> means that one connection per URI type
  194. will be opened.</para></listitem>
  195. </varlistentry>
  196. <varlistentry><term>Retries</term>
  197. <listitem><para>Number of retries to perform. If this is non-zero APT will retry failed
  198. files the given number of times.</para></listitem>
  199. </varlistentry>
  200. <varlistentry><term>Source-Symlinks</term>
  201. <listitem><para>Use symlinks for source archives. If set to true then source archives will
  202. be symlinked when possible instead of copying. True is the default.</para></listitem>
  203. </varlistentry>
  204. <varlistentry><term>http</term>
  205. <listitem><para>HTTP URIs; http::Proxy is the default http proxy to use. It is in the
  206. standard form of <literal>http://[[user][:pass]@]host[:port]/</literal>. Per
  207. host proxies can also be specified by using the form
  208. <literal>http::Proxy::&lt;host&gt;</literal> with the special keyword <literal>DIRECT</literal>
  209. meaning to use no proxies. If no one of the above settings is specified,
  210. <envar>http_proxy</envar> environment variable
  211. will be used.</para>
  212. <para>Three settings are provided for cache control with HTTP/1.1 compliant
  213. proxy caches. <literal>No-Cache</literal> tells the proxy to not use its cached
  214. response under any circumstances, <literal>Max-Age</literal> is sent only for
  215. index files and tells the cache to refresh its object if it is older than
  216. the given number of seconds. Debian updates its index files daily so the
  217. default is 1 day. <literal>No-Store</literal> specifies that the cache should never
  218. store this request, it is only set for archive files. This may be useful
  219. to prevent polluting a proxy cache with very large .deb files. Note:
  220. Squid 2.0.2 does not support any of these options.</para>
  221. <para>The option <literal>timeout</literal> sets the timeout timer used by the method,
  222. this applies to all things including connection timeout and data timeout.</para>
  223. <para>One setting is provided to control the pipeline depth in cases where the
  224. remote server is not RFC conforming or buggy (such as Squid 2.0.2)
  225. <literal>Acquire::http::Pipeline-Depth</literal> can be a value from 0 to 5
  226. indicating how many outstanding requests APT should send. A value of
  227. zero MUST be specified if the remote host does not properly linger
  228. on TCP connections - otherwise data corruption will occur. Hosts which
  229. require this are in violation of RFC 2068.</para>
  230. <para>The used bandwidth can be limited with <literal>Acquire::http::Dl-Limit</literal>
  231. which accepts integer values in kilobyte. The default value is 0 which deactivates
  232. the limit and tries uses as much as possible of the bandwidth (Note that this option implicit
  233. deactivates the download from multiple servers at the same time.)</para></listitem>
  234. </varlistentry>
  235. <varlistentry><term>https</term>
  236. <listitem><para>HTTPS URIs. Cache-control and proxy options are the same as for
  237. <literal>http</literal> method.
  238. <literal>Pipeline-Depth</literal> option is not supported yet.</para>
  239. <para><literal>CaInfo</literal> suboption specifies place of file that
  240. holds info about trusted certificates.
  241. <literal>&lt;host&gt;::CaInfo</literal> is corresponding per-host option.
  242. <literal>Verify-Peer</literal> boolean suboption determines whether verify
  243. server's host certificate against trusted certificates or not.
  244. <literal>&lt;host&gt;::Verify-Peer</literal> is corresponding per-host option.
  245. <literal>Verify-Host</literal> boolean suboption determines whether verify
  246. server's hostname or not.
  247. <literal>&lt;host&gt;::Verify-Host</literal> is corresponding per-host option.
  248. <literal>SslCert</literal> determines what certificate to use for client
  249. authentication. <literal>&lt;host&gt;::SslCert</literal> is corresponding per-host option.
  250. <literal>SslKey</literal> determines what private key to use for client
  251. authentication. <literal>&lt;host&gt;::SslKey</literal> is corresponding per-host option.
  252. <literal>SslForceVersion</literal> overrides default SSL version to use.
  253. Can contain 'TLSv1' or 'SSLv3' string.
  254. <literal>&lt;host&gt;::SslForceVersion</literal> is corresponding per-host option.
  255. </para></listitem></varlistentry>
  256. <varlistentry><term>ftp</term>
  257. <listitem><para>FTP URIs; ftp::Proxy is the default ftp proxy to use. It is in the
  258. standard form of <literal>ftp://[[user][:pass]@]host[:port]/</literal>. Per
  259. host proxies can also be specified by using the form
  260. <literal>ftp::Proxy::&lt;host&gt;</literal> with the special keyword <literal>DIRECT</literal>
  261. meaning to use no proxies. If no one of the above settings is specified,
  262. <envar>ftp_proxy</envar> environment variable
  263. will be used. To use a ftp
  264. proxy you will have to set the <literal>ftp::ProxyLogin</literal> script in the
  265. configuration file. This entry specifies the commands to send to tell
  266. the proxy server what to connect to. Please see
  267. &configureindex; for an example of
  268. how to do this. The substitution variables available are
  269. <literal>$(PROXY_USER)</literal> <literal>$(PROXY_PASS)</literal> <literal>$(SITE_USER)</literal>
  270. <literal>$(SITE_PASS)</literal> <literal>$(SITE)</literal> and <literal>$(SITE_PORT)</literal>
  271. Each is taken from it's respective URI component.</para>
  272. <para>The option <literal>timeout</literal> sets the timeout timer used by the method,
  273. this applies to all things including connection timeout and data timeout.</para>
  274. <para>Several settings are provided to control passive mode. Generally it is
  275. safe to leave passive mode on, it works in nearly every environment.
  276. However some situations require that passive mode be disabled and port
  277. mode ftp used instead. This can be done globally, for connections that
  278. go through a proxy or for a specific host (See the sample config file
  279. for examples).</para>
  280. <para>It is possible to proxy FTP over HTTP by setting the <envar>ftp_proxy</envar>
  281. environment variable to a http url - see the discussion of the http method
  282. above for syntax. You cannot set this in the configuration file and it is
  283. not recommended to use FTP over HTTP due to its low efficiency.</para>
  284. <para>The setting <literal>ForceExtended</literal> controls the use of RFC2428
  285. <literal>EPSV</literal> and <literal>EPRT</literal> commands. The default is false, which means
  286. these commands are only used if the control connection is IPv6. Setting this
  287. to true forces their use even on IPv4 connections. Note that most FTP servers
  288. do not support RFC2428.</para></listitem>
  289. </varlistentry>
  290. <varlistentry><term>cdrom</term>
  291. <listitem><para>CDROM URIs; the only setting for CDROM URIs is the mount point,
  292. <literal>cdrom::Mount</literal> which must be the mount point for the CDROM drive
  293. as specified in <filename>/etc/fstab</filename>. It is possible to provide
  294. alternate mount and unmount commands if your mount point cannot be listed
  295. in the fstab (such as an SMB mount and old mount packages). The syntax
  296. is to put <literallayout>/cdrom/::Mount "foo";</literallayout> within
  297. the cdrom block. It is important to have the trailing slash. Unmount
  298. commands can be specified using UMount.</para></listitem>
  299. </varlistentry>
  300. <varlistentry><term>gpgv</term>
  301. <listitem><para>GPGV URIs; the only option for GPGV URIs is the option to pass additional parameters to gpgv.
  302. <literal>gpgv::Options</literal> Additional options passed to gpgv.
  303. </para></listitem>
  304. </varlistentry>
  305. <varlistentry><term>CompressionTypes</term>
  306. <listitem><para>List of compression types which are understood by the acquire methods.
  307. Files like <filename>Packages</filename> can be available in various compression formats.
  308. Per default the acquire methods can decompress <command>bzip2</command>, <command>lzma</command>
  309. and <command>gzip</command> compressed files, with this setting more formats can be added
  310. on the fly or the used method can be changed. The syntax for this is:
  311. <synopsis>Acquire::CompressionTypes::<replaceable>FileExtension</replaceable> "<replaceable>Methodname</replaceable>";</synopsis>
  312. </para><para>Also the <literal>Order</literal> subgroup can be used to define in which order
  313. the acquire system will try to download the compressed files. The acquire system will try the first
  314. and proceed with the next compression type in this list on error, so to prefer one over the other type
  315. simple add the preferred type at first - not already added default types will be added at run time
  316. to the end of the list, so e.g. <synopsis>Acquire::CompressionTypes::Order:: "gz";</synopsis> can
  317. be used to prefer <command>gzip</command> compressed files over <command>bzip2</command> and <command>lzma</command>.
  318. If <command>lzma</command> should be preferred over <command>gzip</command> and <command>bzip2</command> the
  319. configure setting should look like this <synopsis>Acquire::CompressionTypes::Order { "lzma"; "gz"; };</synopsis>
  320. It is not needed to add <literal>bz2</literal> explicit to the list as it will be added automatic.</para>
  321. <para>Note that at run time the <literal>Dir::Bin::<replaceable>Methodname</replaceable></literal> will
  322. be checked: If this setting exists the method will only be used if this file exists, e.g. for
  323. the bzip2 method (the inbuilt) setting is <literallayout>Dir::Bin::bzip2 "/bin/bzip2";</literallayout>
  324. Note also that list entries specified on the command line will be added at the end of the list
  325. specified in the configuration files, but before the default entries. To prefer a type in this case
  326. over the ones specified in in the configuration files you can set the option direct - not in list style.
  327. This will not override the defined list, it will only prefix the list with this type.</para>
  328. <para>While it is possible to add an empty compression type to the order list, but APT in its current
  329. version doesn't understand it correctly and will display many warnings about not downloaded files -
  330. these warnings are most of the time false negatives. Future versions will maybe include a way to
  331. really prefer uncompressed files to support the usage of local mirrors.</para></listitem>
  332. </varlistentry>
  333. </variablelist>
  334. </para>
  335. </refsect1>
  336. <refsect1><title>Directories</title>
  337. <para>The <literal>Dir::State</literal> section has directories that pertain to local
  338. state information. <literal>lists</literal> is the directory to place downloaded
  339. package lists in and <literal>status</literal> is the name of the dpkg status file.
  340. <literal>preferences</literal> is the name of the APT preferences file.
  341. <literal>Dir::State</literal> contains the default directory to prefix on all sub
  342. items if they do not start with <filename>/</filename> or <filename>./</filename>.</para>
  343. <para><literal>Dir::Cache</literal> contains locations pertaining to local cache
  344. information, such as the two package caches <literal>srcpkgcache</literal> and
  345. <literal>pkgcache</literal> as well as the location to place downloaded archives,
  346. <literal>Dir::Cache::archives</literal>. Generation of caches can be turned off
  347. by setting their names to be blank. This will slow down startup but
  348. save disk space. It is probably preferred to turn off the pkgcache rather
  349. than the srcpkgcache. Like <literal>Dir::State</literal> the default
  350. directory is contained in <literal>Dir::Cache</literal></para>
  351. <para><literal>Dir::Etc</literal> contains the location of configuration files,
  352. <literal>sourcelist</literal> gives the location of the sourcelist and
  353. <literal>main</literal> is the default configuration file (setting has no effect,
  354. unless it is done from the config file specified by
  355. <envar>APT_CONFIG</envar>).</para>
  356. <para>The <literal>Dir::Parts</literal> setting reads in all the config fragments in
  357. lexical order from the directory specified. After this is done then the
  358. main config file is loaded.</para>
  359. <para>Binary programs are pointed to by <literal>Dir::Bin</literal>. <literal>Dir::Bin::Methods</literal>
  360. specifies the location of the method handlers and <literal>gzip</literal>,
  361. <literal>bzip2</literal>, <literal>lzma</literal>,
  362. <literal>dpkg</literal>, <literal>apt-get</literal> <literal>dpkg-source</literal>
  363. <literal>dpkg-buildpackage</literal> and <literal>apt-cache</literal> specify the location
  364. of the respective programs.</para>
  365. <para>
  366. The configuration item <literal>RootDir</literal> has a special
  367. meaning. If set, all paths in <literal>Dir::</literal> will be
  368. relative to <literal>RootDir</literal>, <emphasis>even paths that
  369. are specified absolutely</emphasis>. So, for instance, if
  370. <literal>RootDir</literal> is set to
  371. <filename>/tmp/staging</filename> and
  372. <literal>Dir::State::status</literal> is set to
  373. <filename>/var/lib/dpkg/status</filename>, then the status file
  374. will be looked up in
  375. <filename>/tmp/staging/var/lib/dpkg/status</filename>.
  376. </para>
  377. </refsect1>
  378. <refsect1><title>APT in DSelect</title>
  379. <para>
  380. When APT is used as a &dselect; method several configuration directives
  381. control the default behaviour. These are in the <literal>DSelect</literal> section.</para>
  382. <variablelist>
  383. <varlistentry><term>Clean</term>
  384. <listitem><para>Cache Clean mode; this value may be one of always, prompt, auto,
  385. pre-auto and never. always and prompt will remove all packages from
  386. the cache after upgrading, prompt (the default) does so conditionally.
  387. auto removes only those packages which are no longer downloadable
  388. (replaced with a new version for instance). pre-auto performs this
  389. action before downloading new packages.</para></listitem>
  390. </varlistentry>
  391. <varlistentry><term>options</term>
  392. <listitem><para>The contents of this variable is passed to &apt-get; as command line
  393. options when it is run for the install phase.</para></listitem>
  394. </varlistentry>
  395. <varlistentry><term>Updateoptions</term>
  396. <listitem><para>The contents of this variable is passed to &apt-get; as command line
  397. options when it is run for the update phase.</para></listitem>
  398. </varlistentry>
  399. <varlistentry><term>PromptAfterUpdate</term>
  400. <listitem><para>If true the [U]pdate operation in &dselect; will always prompt to continue.
  401. The default is to prompt only on error.</para></listitem>
  402. </varlistentry>
  403. </variablelist>
  404. </refsect1>
  405. <refsect1><title>How APT calls dpkg</title>
  406. <para>Several configuration directives control how APT invokes &dpkg;. These are
  407. in the <literal>DPkg</literal> section.</para>
  408. <variablelist>
  409. <varlistentry><term>options</term>
  410. <listitem><para>This is a list of options to pass to dpkg. The options must be specified
  411. using the list notation and each list item is passed as a single argument
  412. to &dpkg;.</para></listitem>
  413. </varlistentry>
  414. <varlistentry><term>Pre-Invoke</term><term>Post-Invoke</term>
  415. <listitem><para>This is a list of shell commands to run before/after invoking &dpkg;.
  416. Like <literal>options</literal> this must be specified in list notation. The
  417. commands are invoked in order using <filename>/bin/sh</filename>, should any
  418. fail APT will abort.</para></listitem>
  419. </varlistentry>
  420. <varlistentry><term>Pre-Install-Pkgs</term>
  421. <listitem><para>This is a list of shell commands to run before invoking dpkg. Like
  422. <literal>options</literal> this must be specified in list notation. The commands
  423. are invoked in order using <filename>/bin/sh</filename>, should any fail APT
  424. will abort. APT will pass to the commands on standard input the
  425. filenames of all .deb files it is going to install, one per line.</para>
  426. <para>Version 2 of this protocol dumps more information, including the
  427. protocol version, the APT configuration space and the packages, files
  428. and versions being changed. Version 2 is enabled by setting
  429. <literal>DPkg::Tools::options::cmd::Version</literal> to 2. <literal>cmd</literal> is a
  430. command given to <literal>Pre-Install-Pkgs</literal>.</para></listitem>
  431. </varlistentry>
  432. <varlistentry><term>Run-Directory</term>
  433. <listitem><para>APT chdirs to this directory before invoking dpkg, the default is
  434. <filename>/</filename>.</para></listitem>
  435. </varlistentry>
  436. <varlistentry><term>Build-options</term>
  437. <listitem><para>These options are passed to &dpkg-buildpackage; when compiling packages,
  438. the default is to disable signing and produce all binaries.</para></listitem>
  439. </varlistentry>
  440. </variablelist>
  441. <refsect2><title>dpkg trigger usage (and related options)</title>
  442. <para>APT can call dpkg in a way so it can make aggressive use of triggers over
  443. multiply calls of dpkg. Without further options dpkg will use triggers only in between his
  444. own run. Activating these options can therefore decrease the time needed to perform the
  445. install / upgrade. Note that it is intended to activate these options per default in the
  446. future, but as it changes the way APT calling dpkg drastically it needs a lot more testing.
  447. <emphasis>These options are therefore currently experimental and should not be used in
  448. productive environments.</emphasis> Also it breaks the progress reporting so all frontends will
  449. currently stay around half (or more) of the time in the 100% state while it actually configures
  450. all packages.</para>
  451. <para>Note that it is not guaranteed that APT will support these options or that these options will
  452. not cause (big) trouble in the future. If you have understand the current risks and problems with
  453. these options, but are brave enough to help testing them create a new configuration file and test a
  454. combination of options. Please report any bugs, problems and improvements you encounter and make sure
  455. to note which options you have used in your reports. Asking dpkg for help could also be useful for
  456. debugging proposes, see e.g. <command>dpkg --audit</command>. A defensive option combination would be
  457. <literallayout>DPkg::NoTriggers "true";
  458. PackageManager::Configure "smart";
  459. DPkg::ConfigurePending "true";
  460. DPkg::TriggersPending "true";</literallayout></para>
  461. <variablelist>
  462. <varlistentry><term>DPkg::NoTriggers</term>
  463. <listitem><para>Add the no triggers flag to all dpkg calls (expect the ConfigurePending call).
  464. See &dpkg; if you are interested in what this actually means. In short: dpkg will not run the
  465. triggers then this flag is present unless it is explicit called to do so in an extra call.
  466. Note that this option exists (undocumented) also in older apt versions with a slightly different
  467. meaning: Previously these option only append --no-triggers to the configure calls to dpkg -
  468. now apt will add these flag also to the unpack and remove calls.</para></listitem>
  469. </varlistentry>
  470. <varlistentry><term>PackageManager::Configure</term>
  471. <listitem><para>Valid values are "<literal>all</literal>", "<literal>smart</literal>" and "<literal>no</literal>".
  472. "<literal>all</literal>" is the default value and causes APT to configure all packages explicit.
  473. The "<literal>smart</literal>" way is it to configure only packages which need to be configured before
  474. another package can be unpacked (Pre-Depends) and let the rest configure by dpkg with a call generated
  475. by the next option. "<literal>no</literal>" on the other hand will not configure anything and totally
  476. relay on dpkg for configuration (which will at the moment fail if a Pre-Depends is encountered).
  477. Setting this option to another than the all value will implicit activate also the next option per
  478. default as otherwise the system could end in an unconfigured status which could be unbootable!
  479. </para></listitem>
  480. </varlistentry>
  481. <varlistentry><term>DPkg::ConfigurePending</term>
  482. <listitem><para>If this option is set apt will call <command>dpkg --configure --pending</command>
  483. to let dpkg handle all required configurations and triggers. This option is activated automatic
  484. per default if the previous option is not set to <literal>all</literal>, but deactivating could be useful
  485. if you want to run APT multiple times in a row - e.g. in an installer. In this sceneries you could
  486. deactivate this option in all but the last run.</para></listitem>
  487. </varlistentry>
  488. <varlistentry><term>DPkg::TriggersPending</term>
  489. <listitem><para>Useful for <literal>smart</literal> configuration as a package which has pending
  490. triggers is not considered as <literal>installed</literal> and dpkg treats them as <literal>unpacked</literal>
  491. currently which is a dealbreaker for Pre-Dependencies (see debbugs #526774). Note that this will
  492. process all triggers, not only the triggers needed to configure this package.</para></listitem>
  493. </varlistentry>
  494. <varlistentry><term>PackageManager::UnpackAll</term>
  495. <listitem><para>As the configuration can be deferred to be done at the end by dpkg it can be
  496. tried to order the unpack series only by critical needs, e.g. by Pre-Depends. Default is true
  497. and therefore the "old" method of ordering in various steps by everything. While both method
  498. were present in earlier APT versions the <literal>OrderCritical</literal> method was unused, so
  499. this method is very experimental and needs further improvements before becoming really useful.
  500. </para></listitem>
  501. </varlistentry>
  502. <varlistentry><term>OrderList::Score::Immediate</term>
  503. <listitem><para>Essential packages (and there dependencies) should be configured immediately
  504. after unpacking. It will be a good idea to do this quite early in the upgrade process as these
  505. these configure calls require currently also <literal>DPkg::TriggersPending</literal> which
  506. will run quite a few triggers (which maybe not needed). Essentials get per default a high score
  507. but the immediate flag is relatively low (a package which has a Pre-Depends is higher rated).
  508. These option and the others in the same group can be used to change the scoring. The following
  509. example shows the settings with there default values.
  510. <literallayout>OrderList::Score {
  511. Delete 500;
  512. Essential 200;
  513. Immediate 10;
  514. PreDepends 50;
  515. };</literallayout>
  516. </para></listitem>
  517. </varlistentry>
  518. </variablelist>
  519. </refsect2>
  520. </refsect1>
  521. <refsect1>
  522. <title>Periodic and Archives options</title>
  523. <para><literal>APT::Periodic</literal> and <literal>APT::Archives</literal>
  524. groups of options configure behavior of apt periodic updates, which is
  525. done by <literal>/etc/cron.daily/apt</literal> script. See header of
  526. this script for the brief documentation of these options.
  527. </para>
  528. </refsect1>
  529. <refsect1>
  530. <title>Debug options</title>
  531. <para>
  532. Enabling options in the <literal>Debug::</literal> section will
  533. cause debugging information to be sent to the standard error
  534. stream of the program utilizing the <literal>apt</literal>
  535. libraries, or enable special program modes that are primarily
  536. useful for debugging the behavior of <literal>apt</literal>.
  537. Most of these options are not interesting to a normal user, but a
  538. few may be:
  539. <itemizedlist>
  540. <listitem>
  541. <para>
  542. <literal>Debug::pkgProblemResolver</literal> enables output
  543. about the decisions made by
  544. <literal>dist-upgrade, upgrade, install, remove, purge</literal>.
  545. </para>
  546. </listitem>
  547. <listitem>
  548. <para>
  549. <literal>Debug::NoLocking</literal> disables all file
  550. locking. This can be used to run some operations (for
  551. instance, <literal>apt-get -s install</literal>) as a
  552. non-root user.
  553. </para>
  554. </listitem>
  555. <listitem>
  556. <para>
  557. <literal>Debug::pkgDPkgPM</literal> prints out the actual
  558. command line each time that <literal>apt</literal> invokes
  559. &dpkg;.
  560. </para>
  561. </listitem>
  562. <listitem>
  563. <para>
  564. <literal>Debug::IdentCdrom</literal> disables the inclusion
  565. of statfs data in CDROM IDs. <!-- TODO: provide a
  566. motivating example, except I haven't a clue why you'd want
  567. to do this. -->
  568. </para>
  569. </listitem>
  570. </itemizedlist>
  571. </para>
  572. <para>
  573. A full list of debugging options to apt follows.
  574. </para>
  575. <variablelist>
  576. <varlistentry>
  577. <term><literal>Debug::Acquire::cdrom</literal></term>
  578. <listitem>
  579. <para>
  580. Print information related to accessing
  581. <literal>cdrom://</literal> sources.
  582. </para>
  583. </listitem>
  584. </varlistentry>
  585. <varlistentry>
  586. <term><literal>Debug::Acquire::ftp</literal></term>
  587. <listitem>
  588. <para>
  589. Print information related to downloading packages using
  590. FTP.
  591. </para>
  592. </listitem>
  593. </varlistentry>
  594. <varlistentry>
  595. <term><literal>Debug::Acquire::http</literal></term>
  596. <listitem>
  597. <para>
  598. Print information related to downloading packages using
  599. HTTP.
  600. </para>
  601. </listitem>
  602. </varlistentry>
  603. <varlistentry>
  604. <term><literal>Debug::Acquire::https</literal></term>
  605. <listitem>
  606. <para>
  607. Print information related to downloading packages using
  608. HTTPS.
  609. </para>
  610. </listitem>
  611. </varlistentry>
  612. <varlistentry>
  613. <term><literal>Debug::Acquire::gpgv</literal></term>
  614. <listitem>
  615. <para>
  616. Print information related to verifying cryptographic
  617. signatures using <literal>gpg</literal>.
  618. </para>
  619. </listitem>
  620. </varlistentry>
  621. <varlistentry>
  622. <term><literal>Debug::aptcdrom</literal></term>
  623. <listitem>
  624. <para>
  625. Output information about the process of accessing
  626. collections of packages stored on CD-ROMs.
  627. </para>
  628. </listitem>
  629. </varlistentry>
  630. <varlistentry>
  631. <term><literal>Debug::BuildDeps</literal></term>
  632. <listitem>
  633. <para>
  634. Describes the process of resolving build-dependencies in
  635. &apt-get;.
  636. </para>
  637. </listitem>
  638. </varlistentry>
  639. <varlistentry>
  640. <term><literal>Debug::Hashes</literal></term>
  641. <listitem>
  642. <para>
  643. Output each cryptographic hash that is generated by the
  644. <literal>apt</literal> libraries.
  645. </para>
  646. </listitem>
  647. </varlistentry>
  648. <varlistentry>
  649. <term><literal>Debug::IdentCDROM</literal></term>
  650. <listitem>
  651. <para>
  652. Do not include information from <literal>statfs</literal>,
  653. namely the number of used and free blocks on the CD-ROM
  654. filesystem, when generating an ID for a CD-ROM.
  655. </para>
  656. </listitem>
  657. </varlistentry>
  658. <varlistentry>
  659. <term><literal>Debug::NoLocking</literal></term>
  660. <listitem>
  661. <para>
  662. Disable all file locking. For instance, this will allow
  663. two instances of <quote><literal>apt-get
  664. update</literal></quote> to run at the same time.
  665. </para>
  666. </listitem>
  667. </varlistentry>
  668. <varlistentry>
  669. <term><literal>Debug::pkgAcquire</literal></term>
  670. <listitem>
  671. <para>
  672. Log when items are added to or removed from the global
  673. download queue.
  674. </para>
  675. </listitem>
  676. </varlistentry>
  677. <varlistentry>
  678. <term><literal>Debug::pkgAcquire::Auth</literal></term>
  679. <listitem>
  680. <para>
  681. Output status messages and errors related to verifying
  682. checksums and cryptographic signatures of downloaded files.
  683. </para>
  684. </listitem>
  685. </varlistentry>
  686. <varlistentry>
  687. <term><literal>Debug::pkgAcquire::Diffs</literal></term>
  688. <listitem>
  689. <para>
  690. Output information about downloading and applying package
  691. index list diffs, and errors relating to package index list
  692. diffs.
  693. </para>
  694. </listitem>
  695. </varlistentry>
  696. <varlistentry>
  697. <term><literal>Debug::pkgAcquire::RRed</literal></term>
  698. <listitem>
  699. <para>
  700. Output information related to patching apt package lists
  701. when downloading index diffs instead of full indices.
  702. </para>
  703. </listitem>
  704. </varlistentry>
  705. <varlistentry>
  706. <term><literal>Debug::pkgAcquire::Worker</literal></term>
  707. <listitem>
  708. <para>
  709. Log all interactions with the sub-processes that actually
  710. perform downloads.
  711. </para>
  712. </listitem>
  713. </varlistentry>
  714. <varlistentry>
  715. <term><literal>Debug::pkgAutoRemove</literal></term>
  716. <listitem>
  717. <para>
  718. Log events related to the automatically-installed status of
  719. packages and to the removal of unused packages.
  720. </para>
  721. </listitem>
  722. </varlistentry>
  723. <varlistentry>
  724. <term><literal>Debug::pkgDepCache::AutoInstall</literal></term>
  725. <listitem>
  726. <para>
  727. Generate debug messages describing which packages are being
  728. automatically installed to resolve dependencies. This
  729. corresponds to the initial auto-install pass performed in,
  730. e.g., <literal>apt-get install</literal>, and not to the
  731. full <literal>apt</literal> dependency resolver; see
  732. <literal>Debug::pkgProblemResolver</literal> for that.
  733. </para>
  734. </listitem>
  735. </varlistentry>
  736. <varlistentry>
  737. <term><literal>Debug::pkgDepCache::Marker</literal></term>
  738. <listitem>
  739. <para>
  740. Generate debug messages describing which package is marked
  741. as keep/install/remove while the ProblemResolver does his work.
  742. Each addition or deletion may trigger additional actions;
  743. they are shown indented two additional space under the original entry.
  744. The format for each line is <literal>MarkKeep</literal>,
  745. <literal>MarkDelete</literal> or <literal>MarkInstall</literal> followed by
  746. <literal>package-name &lt;a.b.c -&gt; d.e.f | x.y.z&gt; (section)</literal>
  747. where <literal>a.b.c</literal> is the current version of the package,
  748. <literal>d.e.f</literal> is the version considered for installation and
  749. <literal>x.y.z</literal> is a newer version, but not considered for installation
  750. (because of a low pin score). The later two can be omitted if there is none or if
  751. it is the same version as the installed.
  752. <literal>section</literal> is the name of the section the package appears in.
  753. </para>
  754. </listitem>
  755. </varlistentry>
  756. <!-- Question: why doesn't this do anything? The code says it should. -->
  757. <varlistentry>
  758. <term><literal>Debug::pkgInitConfig</literal></term>
  759. <listitem>
  760. <para>
  761. Dump the default configuration to standard error on
  762. startup.
  763. </para>
  764. </listitem>
  765. </varlistentry>
  766. <varlistentry>
  767. <term><literal>Debug::pkgDPkgPM</literal></term>
  768. <listitem>
  769. <para>
  770. When invoking &dpkg;, output the precise command line with
  771. which it is being invoked, with arguments separated by a
  772. single space character.
  773. </para>
  774. </listitem>
  775. </varlistentry>
  776. <varlistentry>
  777. <term><literal>Debug::pkgDPkgProgressReporting</literal></term>
  778. <listitem>
  779. <para>
  780. Output all the data received from &dpkg; on the status file
  781. descriptor and any errors encountered while parsing it.
  782. </para>
  783. </listitem>
  784. </varlistentry>
  785. <varlistentry>
  786. <term><literal>Debug::pkgOrderList</literal></term>
  787. <listitem>
  788. <para>
  789. Generate a trace of the algorithm that decides the order in
  790. which <literal>apt</literal> should pass packages to
  791. &dpkg;.
  792. </para>
  793. </listitem>
  794. </varlistentry>
  795. <varlistentry>
  796. <term><literal>Debug::pkgPackageManager</literal></term>
  797. <listitem>
  798. <para>
  799. Output status messages tracing the steps performed when
  800. invoking &dpkg;.
  801. </para>
  802. </listitem>
  803. </varlistentry>
  804. <varlistentry>
  805. <term><literal>Debug::pkgPolicy</literal></term>
  806. <listitem>
  807. <para>
  808. Output the priority of each package list on startup.
  809. </para>
  810. </listitem>
  811. </varlistentry>
  812. <varlistentry>
  813. <term><literal>Debug::pkgProblemResolver</literal></term>
  814. <listitem>
  815. <para>
  816. Trace the execution of the dependency resolver (this
  817. applies only to what happens when a complex dependency
  818. problem is encountered).
  819. </para>
  820. </listitem>
  821. </varlistentry>
  822. <varlistentry>
  823. <term><literal>Debug::pkgProblemResolver::ShowScores</literal></term>
  824. <listitem>
  825. <para>
  826. Display a list of all installed packages with their calculated score
  827. used by the pkgProblemResolver. The description of the package
  828. is the same as described in <literal>Debug::pkgDepCache::Marker</literal>
  829. </para>
  830. </listitem>
  831. </varlistentry>
  832. <varlistentry>
  833. <term><literal>Debug::sourceList</literal></term>
  834. <listitem>
  835. <para>
  836. Print information about the vendors read from
  837. <filename>/etc/apt/vendors.list</filename>.
  838. </para>
  839. </listitem>
  840. </varlistentry>
  841. <!-- 2009/07/11 Currently used nowhere. The corresponding code
  842. is commented.
  843. <varlistentry>
  844. <term><literal>Debug::Vendor</literal></term>
  845. <listitem>
  846. <para>
  847. Print information about each vendor.
  848. </para>
  849. </listitem>
  850. </varlistentry>
  851. -->
  852. </variablelist>
  853. </refsect1>
  854. <refsect1><title>Examples</title>
  855. <para>&configureindex; is a
  856. configuration file showing example values for all possible
  857. options.</para>
  858. </refsect1>
  859. <refsect1><title>Files</title>
  860. <variablelist>
  861. &file-aptconf;
  862. </variablelist>
  863. </refsect1>
  864. <refsect1><title>See Also</title>
  865. <para>&apt-cache;, &apt-config;<!-- ? reading apt.conf -->, &apt-preferences;.</para>
  866. </refsect1>
  867. &manbugs;
  868. </refentry>