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