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