1 <!-- -*- mode: sgml; mode: fold -*- -->
2 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
4 <!ENTITY % aptent SYSTEM "apt.ent">
13 <refentrytitle>apt.conf</>
17 <!-- Man page title -->
20 <refpurpose>Configuration file for APT</>
23 <RefSect1><Title>Description</>
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.
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
41 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). Each line is of the form
44 <literallayout>APT::Get::Assume-Yes "true";</literallayout> The trailing
45 semicolon is required and the quotes are optional. A new scope can be
46 opened with curly braces, like:
47 <informalexample><programlisting>
54 </programlisting></informalexample>
55 with newlines placed to make it more readable. Lists can be created by
56 opening a scope and including a single word enclosed in quotes followed by a
57 semicolon. Multiple entries can be included, each separated by a semicolon.
58 <informalexample><programlisting>
59 DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
60 </programlisting></informalexample>
62 In general the sample configuration file in
63 <filename>&docdir;examples/apt.conf</> &configureindex;
64 is a good guide for how it should look.
66 Two specials are allowed, <literal/#include/ and <literal/#clear/.
67 <literal/#include/ will include the given file, unless the filename
68 ends in a slash, then the whole directory is included.
69 <literal/#clear/ is used to erase a list of names.
71 All of the APT tools take a -o option which allows an arbitrary configuration
72 directive to be specified on the command line. The syntax is a full option
73 name (<literal/APT::Get::Assume-Yes/ for instance) followed by an equals
74 sign then the new value of the option. Lists can be appended too by adding
75 a trailing :: to the list name.
78 <RefSect1><Title>The APT Group</>
80 This group of options controls general APT behavior as well as holding the
81 options for all of the tools.
84 <VarListEntry><Term>Architecture</Term>
86 System Architecture; sets the architecture to use when fetching files and
87 parsing package lists. The internal default is the architecture apt was
91 <VarListEntry><Term>Ignore-Hold</Term>
93 Ignore Held packages; This global option causes the problem resolver to
94 ignore held packages in its decision making.
97 <VarListEntry><Term>Clean-Installed</Term>
99 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.
105 <VarListEntry><Term>Immediate-Configure</Term>
107 Disable Immediate Configuration; This dangerous option disables some
108 of APT's ordering code to cause it to make fewer dpkg calls. Doing
109 so may be necessary on some extremely slow single user systems but
110 is very dangerous and may cause package install scripts to fail or worse.
111 Use at your own risk.
114 <VarListEntry><Term>Force-LoopBreak</Term>
116 Never Enable this option unless you -really- know what you are doing. It
117 permits APT to temporarily remove an essential package to break a
118 Conflicts/Conflicts or Conflicts/Pre-Depend loop between two essential
119 packages. SUCH A LOOP SHOULD NEVER EXIST AND IS A GRAVE BUG. This option
120 will work if the essential packages are not tar, gzip, libc, dpkg, bash or
121 anything that those packages depend on.
124 <VarListEntry><Term>Cache-Limit</Term>
126 APT uses a fixed size memory mapped cache file to store the 'available'
127 information. This sets the size of that cache.
130 <VarListEntry><Term>Build-Essential</Term>
132 Defines which package(s) are considered essential build dependencies.
135 <VarListEntry><Term>Get</Term>
137 The Get subsection controls the &apt-get; tool, please see its
138 documentation for more information about the options here.
141 <VarListEntry><Term>Cache</Term>
143 The Cache subsection controls the &apt-cache; tool, please see its
144 documentation for more information about the options here.
147 <VarListEntry><Term>CDROM</Term>
149 The CDROM subsection controls the &apt-cdrom; tool, please see its
150 documentation for more information about the options here.
155 <RefSect1><Title>The Acquire Group</>
157 The <literal/Acquire/ group of options controls the download of packages
158 and the URI handlers.
161 <VarListEntry><Term>Queue-Mode</Term>
163 Queuing mode; <literal/Queue-Mode/ can be one of <literal/host/ or
164 <literal/access/ which determines how APT parallelizes outgoing
165 connections. <literal/host/ means that one connection per target host
166 will be opened, <literal/access/ means that one connection per URI type
170 <VarListEntry><Term>Retries</Term>
172 Number of retries to perform. If this is non-zero APT will retry failed
173 files the given number of times.
176 <VarListEntry><Term>Source-Symlinks</Term>
178 Use symlinks for source archives. If set to true then source archives will
179 be symlinked when possible instead of copying. True is the default
182 <VarListEntry><Term>http</Term>
184 HTTP URIs; http::Proxy is the default http proxy to use. It is in the
185 standard form of <literal>http://[[user][:pass]@]host[:port]/</>. Per
186 host proxies can also be specified by using the form
187 <literal/http::Proxy::<host>/ with the special keyword <literal/DIRECT/
188 meaning to use no proxies. The <envar/http_proxy/ environment variable
189 will override all settings.
191 Three settings are provided for cache control with HTTP/1.1 compliant
192 proxy caches. <literal/No-Cache/ tells the proxy to not use its cached
193 response under any circumstances, <literal/Max-Age/ is sent only for
194 index files and tells the cache to refresh its object if it is older than
195 the given number of seconds. Debian updates its index files daily so the
196 default is 1 day. <literal/No-Store/ specifies that the cache should never
197 store this request, it is only set for archive files. This may be useful
198 to prevent polluting a proxy cache with very large .deb files. Note:
199 Squid 2.0.2 does not support any of these options.
201 The option <literal/timeout/ sets the timeout timer used by the method,
202 this applies to all things including connection timeout and data timeout.
204 One setting is provided to control the pipeline depth in cases where the
205 remote server is not RFC conforming or buggy (such as Squid 2.0.2)
206 <literal/Acquire::http::Pipeline-Depth/ can be a value from 0 to 5
207 indicating how many outstanding requests APT should send. A value of
208 zero MUST be specified if the remote host does not properly linger
209 on TCP connections - otherwise data corruption will occur. Hosts which
210 require this are in violation of RFC 2068.
213 <VarListEntry><Term>ftp</Term>
215 FTP URIs; ftp::Proxy is the default proxy server to use. It is in the
216 standard form of <literal>ftp://[[user][:pass]@]host[:port]/</> and is
217 overridden by the <envar/ftp_proxy/ environment variable. To use a ftp
218 proxy you will have to set the <literal/ftp::ProxyLogin/ script in the
219 configuration file. This entry specifies the commands to send to tell
220 the proxy server what to connect to. Please see
221 &configureindex; for an example of
222 how to do this. The subsitution variables available are
223 <literal/$(PROXY_USER)/, <literal/$(PROXY_PASS)/, <literal/$(SITE_USER)/,
224 <literal/$(SITE_PASS)/, <literal/$(SITE)/, and <literal/$(SITE_PORT)/.
225 Each is taken from it's respective URI component.
227 The option <literal/timeout/ sets the timeout timer used by the method,
228 this applies to all things including connection timeout and data timeout.
230 Several settings are provided to control passive mode. Generally it is
231 safe to leave passive mode on, it works in nearly every environment.
232 However some situations require that passive mode be disabled and port
233 mode ftp used instead. This can be done globally, for connections that
234 go through a proxy or for a specific host (See the sample config file
237 It is possible to proxy FTP over HTTP by setting the <envar/ftp_proxy/
238 environment variable to a http url - see the discussion of the http method
239 above for syntax. You cannot set this in the configuration file and it is
240 not recommended to use FTP over HTTP due to its low efficiency.
242 The setting <literal/ForceExtended/ controls the use of RFC2428
243 <literal/EPSV/ and <literal/EPRT/ commands. The defaut is false, which means
244 these commands are only used if the control connection is IPv6. Setting this
245 to true forces their use even on IPv4 connections. Note that most FTP servers
246 do not support RFC2428.
249 <VarListEntry><Term>cdrom</Term>
251 CDROM URIs; the only setting for CDROM URIs is the mount point,
252 <literal/cdrom::Mount/ which must be the mount point for the CDROM drive
253 as specified in <filename>/etc/fstab</>. It is possible to provide
254 alternate mount and unmount commands if your mount point cannot be listed
255 in the fstab (such as an SMB mount and old mount packages). The syntax
256 is to put <literallayout>"/cdrom/"::Mount "foo";</literallayout> within
257 the cdrom block. It is important to have the trailing slash. Unmount
258 commands can be specified using UMount.
263 <RefSect1><Title>Directories</>
265 The <literal/Dir::State/ section has directories that pertain to local
266 state information. <literal/lists/ is the directory to place downloaded
267 package lists in and <literal/status/ is the name of the dpkg status file.
268 <literal/preferences/ is the name of the APT preferences file.
269 <literal/Dir::State/ contains the default directory to prefix on all sub
270 items if they do not start with <filename>/</> or <filename>./</>.
272 <literal/Dir::Cache/ contains locations pertaining to local cache
273 information, such as the two package caches <literal/srcpkgcache/ and
274 <literal/pkgcache/ as well as the location to place downloaded archives,
275 <literal/Dir::Cache::archives/. Generation of caches can be turned off
276 by setting their names to be blank. This will slow down startup but
277 save disk space. It is probably prefered to turn off the pkgcache rather
278 than the srcpkgcache. Like <literal/Dir::State/ the default
279 directory is contained in <literal/Dir::Cache/
281 <literal/Dir::Etc/ contains the location of configuration files,
282 <literal/sourcelist/ gives the location of the sourcelist and
283 <literal/main/ is the default configuration file (setting has no effect,
284 unless it is done from the config file specified by
287 The <literal/Dir::Parts/ setting reads in all the config fragments in
288 lexical order from the directory specified. After this is done then the
289 main config file is loaded.
291 Binary programs are pointed to by <literal/Dir::Bin/. <literal/Dir::Bin::Methods/
292 specifies the location of the method handlers and <literal/gzip/,
293 <literal/dpkg/, <literal/apt-get/, <literal/dpkg-source/,
294 <literal/dpkg-buildpackage/ and <literal/apt-cache/ specify the location
295 of the respective programs.
298 <RefSect1><Title>APT in DSelect</>
300 When APT is used as a &dselect; method several configuration directives
301 control the default behaviour. These are in the <literal/DSelect/ section.
304 <VarListEntry><Term>Clean</Term>
306 Cache Clean mode; this value may be one of always, prompt, auto,
307 pre-auto and never. always and prompt will remove all packages from
308 the cache after upgrading, prompt (the default) does so conditionally.
309 auto removes only those packages which are no longer downloadable
310 (replaced with a new version for instance). pre-auto performs this
311 action before downloading new packages.
314 <VarListEntry><Term>Options</Term>
316 The contents of this variable is passed to &apt-get; as command line
317 options when it is run for the install phase.
320 <VarListEntry><Term>UpdateOptions</Term>
322 The contents of this variable is passed to &apt-get; as command line
323 options when it is run for the update phase.
326 <VarListEntry><Term>PromptAfterUpdate</Term>
328 If true the [U]pdate operation in &dselect; will always prompt to continue.
329 The default is to prompt only on error.
334 <RefSect1><Title>How APT calls dpkg</>
336 Several configuration directives control how APT invokes &dpkg;. These are
337 in the <literal/DPkg/ section.
340 <VarListEntry><Term>Options</Term>
342 This is a list of options to pass to dpkg. The options must be specified
343 using the list notation and each list item is passed as a single argument
347 <VarListEntry><Term>Pre-Invoke</Term><Term>Post-Invoke</Term>
349 This is a list of shell commands to run before/after invoking &dpkg;.
350 Like <literal/Options/ this must be specified in list notation. The
351 commands are invoked in order using <filename>/bin/sh</>, should any
355 <VarListEntry><Term>Pre-Install-Pkgs</Term>
357 This is a list of shell commands to run before invoking dpkg. Like
358 <literal/Options/ this must be specified in list notation. The commands
359 are invoked in order using <filename>/bin/sh</>, should any fail APT
360 will abort. APT will pass to the commands on standard input the
361 filenames of all .deb files it is going to install, one per line.
363 Version 2 of this protocol dumps more information, including the
364 protocol version, the APT configuration space and the packages, files
365 and versions being changed. Version 2 is enabled by setting
366 <literal/DPkg::Tools::Options::cmd::Version/ to 2. <literal/cmd/ is a
367 command given to <literal/Pre-Install-Pkgs/.
370 <VarListEntry><Term>Run-Directory</Term>
372 APT chdirs to this directory before invoking dpkg, the default is
376 <VarListEntry><Term>Build-Options</Term>
378 These options are passed to &dpkg-buildpackage; when compiling packages,
379 the default is to disable signing and produce all binaries.
384 <RefSect1><Title>Debug Options</>
386 Most of the options in the <literal/debug/ section are not interesting to
387 the normal user, however <literal/Debug::pkgProblemResolver/ shows
388 interesting output about the decisions dist-upgrade makes.
389 <literal/Debug::NoLocking/ disables file locking so APT can do some
390 operations as non-root and <literal/Debug::pkgDPkgPM/ will print out the
391 command line for each dpkg invokation. <literal/Debug::IdentCdrom/ will
392 disable the inclusion of statfs data in CDROM IDs.
395 <RefSect1><Title>Examples</>
397 &configureindex; contains a
398 sample configuration file showing the default values for all possible
402 <RefSect1><Title>Files</>
404 <filename>/etc/apt/apt.conf</>
407 <RefSect1><Title>See Also</>
409 &apt-cache;, &apt-config;<!-- ? reading apt.conf -->, &apt-preferences;.