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