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