apt.conf.5.xml 46 KB

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