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>Configuratoin 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. 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>
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>
58 DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
59 </programlisting></informalexample>
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.
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.
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.
77 <RefSect1><Title>The APT Group</>
79 This group of options controls general APT behavoir as well as holding the
80 options for all of the tools.
83 <VarListEntry><Term>Architecture</Term>
85 System Architecture; sets the architecture to use when fetching files and
86 parsing package lists. The internal default is the architecture apt was
90 <VarListEntry><Term>Ignore-Hold</Term>
92 Ignore Held packages; This global options causes the problem resolver to
93 ignore held packages in its decision making.
96 <VarListEntry><Term>Clean-Installed</Term>
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.
104 <VarListEntry><Term>Immediate-Configure</Term>
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.
113 <VarListEntry><Term>Force-LoopBreak</Term>
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.
123 <VarListEntry><Term>Cache-Limit</Term>
125 APT uses a fixed size memory mapped cache file to store the 'available'
126 information. This sets the size of that cache.
129 <VarListEntry><Term>Get</Term>
131 The Get subsection controls the &apt-get; tool, please see its
132 documentation for more information about the options here.
135 <VarListEntry><Term>Cache</Term>
137 The Cache subsection controls the &apt-cache; tool, please see its
138 documentation for more information about the options here.
141 <VarListEntry><Term>CDROM</Term>
143 The CDROM subsection controls the &apt-cdrom; tool, please see its
144 documentation for more information about the options here.
149 <RefSect1><Title>The Acquire Group</>
151 The <literal/Acquire/ group of options controls the download of packages
152 and the URI handlers.
155 <VarListEntry><Term>Queue-Mode</Term>
157 Queuing mode; <literal/Queue-Mode/ can be one of <literal/host/ or
158 <literal/access/ which determins how APT parallelizes outgoing
159 connections. <literal/host/ means that one connection per target host
160 will be opened, <literal/access/ means that one connection per URI type
164 <VarListEntry><Term>Retries</Term>
166 Number of retries to perform. If this is non-zero APT will retry failed
167 files the given number of times.
170 <VarListEntry><Term>Source-Symlinks</Term>
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
176 <VarListEntry><Term>http</Term>
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::<host>/ with the special keyword <literal/DIRECT/
182 meaning to use no proxies. The <envar/http_proxy/ environment variable
183 will override all settings.
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.
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.
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
203 on TCP connections - otherwise data corruption will occure. Hosts which
204 require this are in violation of RFC 2068.
207 <VarListEntry><Term>ftp</Term>
209 FTP URis; ftp::Proxy is the default proxy server to use. It is in the
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.
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.
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
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.
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.
243 <VarListEntry><Term>cdrom</Term>
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.
257 <RefSect1><Title>Directories</>
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.
262 <literal/preferences/ is the name of the APT preferencse file.
263 <literal/Dir::State/ contains the default directory to prefix on all sub
264 items if they do not start with <filename>/</> or <filename>./</>.
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/
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
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.
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.
292 <RefSect1><Title>APT in DSelect</>
294 When APT is used as a &dselect; method several configuration directives
295 control the default behavoir. These are in the <literal/DSelect/ section.
298 <VarListEntry><Term>Clean</Term>
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.
308 <VarListEntry><Term>Options</Term>
310 The contents of this variable is passed to &apt-get; as command line
311 options when it is run for the install phase.
314 <VarListEntry><Term>UpdateOptions</Term>
316 The contents of this variable is passed to &apt-get; as command line
317 options when it is run for the update phase.
320 <VarListEntry><Term>PromptAfterUpdate</Term>
322 If true the [U]pdate operation in &dselect; will always prompt to continue.
323 The default is to prompt only on error.
328 <RefSect1><Title>How APT calls dpkg</>
330 Several configuration directives control how APT invokes &dpkg;. These are
331 in the <literal/DPkg/ section.
334 <VarListEntry><Term>Options</Term>
336 This is a list of options to pass to dpkg. The options must be specified
337 using the list notation and each list item is passed as a single arugment
341 <VarListEntry><Term>Pre-Invoke</Term><Term>Post-Invoke</Term>
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
349 <VarListEntry><Term>Pre-Install-Pkgs</Term>
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.
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/.
364 <VarListEntry><Term>Run-Directory</Term>
366 APT chdirs to this directory before invoking dpkg, the default is
370 <VarListEntry><Term>Build-Options</Term>
372 These options are passed to &dpkg-buildpackage; when compiling packages,
373 the default is to disable signing and produce all binaries.
378 <RefSect1><Title>Debug Options</>
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.
389 <RefSect1><Title>Examples</>
391 &configureindex; contains a
392 sample configuration file showing the default values for all possible
396 <RefSect1><Title>Files</>
398 <filename>/etc/apt/apt.conf</>
401 <RefSect1><Title>See Also</>
403 &apt-cache;, &apt-conf;, &apt-preferences;.