* Simplified Chinese translation of message catalog fro...
[ntk/apt.git] / doc / apt.conf.5.sgml
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</>
20 <refpurpose>Configuration file for APT</>
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. 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>
48 APT {
49 Get {
50 Assume-Yes "true";
51 Fix-Broken "true";
52 };
53 };
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>
61 <para>
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.
65 <para>
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.
70 <para>
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.
76 </RefSect1>
77
78 <RefSect1><Title>The APT Group</>
79 <para>
80 This group of options controls general APT behavior as well as holding the
81 options for all of the tools.
82
83 <VariableList>
84 <VarListEntry><Term>Architecture</Term>
85 <ListItem><Para>
86 System Architecture; sets the architecture to use when fetching files and
87 parsing package lists. The internal default is the architecture apt was
88 compiled for.
89 </VarListEntry>
90
91 <VarListEntry><Term>Ignore-Hold</Term>
92 <ListItem><Para>
93 Ignore Held packages; This global option causes the problem resolver to
94 ignore held packages in its decision making.
95 </VarListEntry>
96
97 <VarListEntry><Term>Clean-Installed</Term>
98 <ListItem><Para>
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.
103 </VarListEntry>
104
105 <VarListEntry><Term>Immediate-Configure</Term>
106 <ListItem><Para>
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.
112 </VarListEntry>
113
114 <VarListEntry><Term>Force-LoopBreak</Term>
115 <ListItem><Para>
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.
122 </VarListEntry>
123
124 <VarListEntry><Term>Cache-Limit</Term>
125 <ListItem><Para>
126 APT uses a fixed size memory mapped cache file to store the 'available'
127 information. This sets the size of that cache.
128 </VarListEntry>
129
130 <VarListEntry><Term>Build-Essential</Term>
131 <ListItem><Para>
132 Defines which package(s) are considered essential build dependencies.
133 </VarListEntry>
134
135 <VarListEntry><Term>Get</Term>
136 <ListItem><Para>
137 The Get subsection controls the &apt-get; tool, please see its
138 documentation for more information about the options here.
139 </VarListEntry>
140
141 <VarListEntry><Term>Cache</Term>
142 <ListItem><Para>
143 The Cache subsection controls the &apt-cache; tool, please see its
144 documentation for more information about the options here.
145 </VarListEntry>
146
147 <VarListEntry><Term>CDROM</Term>
148 <ListItem><Para>
149 The CDROM subsection controls the &apt-cdrom; tool, please see its
150 documentation for more information about the options here.
151 </VarListEntry>
152 </VariableList>
153 </RefSect1>
154
155 <RefSect1><Title>The Acquire Group</>
156 <para>
157 The <literal/Acquire/ 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>
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
167 will be opened.
168 </VarListEntry>
169
170 <VarListEntry><Term>Retries</Term>
171 <ListItem><Para>
172 Number of retries to perform. If this is non-zero APT will retry failed
173 files the given number of times.
174 </VarListEntry>
175
176 <VarListEntry><Term>Source-Symlinks</Term>
177 <ListItem><Para>
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
180 </VarListEntry>
181
182 <VarListEntry><Term>http</Term>
183 <ListItem><Para>
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::&lt;host&gt;/ with the special keyword <literal/DIRECT/
188 meaning to use no proxies. The <envar/http_proxy/ environment variable
189 will override all settings.
190 <para>
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.
200 <para>
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.
203 <para>
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.
211 </VarListEntry>
212
213 <VarListEntry><Term>ftp</Term>
214 <ListItem><Para>
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.
226 <para>
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.
229 <para>
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
235 for examples)
236 <para>
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.
241 <para>
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.
247 </VarListEntry>
248
249 <VarListEntry><Term>cdrom</Term>
250 <ListItem><Para>
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.
259 </VarListEntry>
260 </VariableList>
261 </RefSect1>
262
263 <RefSect1><Title>Directories</>
264 <para>
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>./</>.
271 <para>
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/
280 <para>
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
285 <envar/APT_CONFIG/).
286 <para>
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.
290 <para>
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.
296 </RefSect1>
297
298 <RefSect1><Title>APT in DSelect</>
299 <para>
300 When APT is used as a &dselect; method several configuration directives
301 control the default behaviour. These are in the <literal/DSelect/ section.
302
303 <VariableList>
304 <VarListEntry><Term>Clean</Term>
305 <ListItem><Para>
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.
312 </VarListEntry>
313
314 <VarListEntry><Term>Options</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 install phase.
318 </VarListEntry>
319
320 <VarListEntry><Term>UpdateOptions</Term>
321 <ListItem><Para>
322 The contents of this variable is passed to &apt-get; as command line
323 options when it is run for the update phase.
324 </VarListEntry>
325
326 <VarListEntry><Term>PromptAfterUpdate</Term>
327 <ListItem><Para>
328 If true the [U]pdate operation in &dselect; will always prompt to continue.
329 The default is to prompt only on error.
330 </VarListEntry>
331 </VariableList>
332 </RefSect1>
333
334 <RefSect1><Title>How APT calls dpkg</>
335 <para>
336 Several configuration directives control how APT invokes &dpkg;. These are
337 in the <literal/DPkg/ section.
338
339 <VariableList>
340 <VarListEntry><Term>Options</Term>
341 <ListItem><Para>
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
344 to &dpkg;.
345 </VarListEntry>
346
347 <VarListEntry><Term>Pre-Invoke</Term><Term>Post-Invoke</Term>
348 <ListItem><Para>
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
352 fail APT will abort.
353 </VarListEntry>
354
355 <VarListEntry><Term>Pre-Install-Pkgs</Term>
356 <ListItem><Para>
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.
362 <para>
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/.
368 </VarListEntry>
369
370 <VarListEntry><Term>Run-Directory</Term>
371 <ListItem><Para>
372 APT chdirs to this directory before invoking dpkg, the default is
373 <filename>/</>.
374 </VarListEntry>
375
376 <VarListEntry><Term>Build-Options</Term>
377 <ListItem><Para>
378 These options are passed to &dpkg-buildpackage; when compiling packages,
379 the default is to disable signing and produce all binaries.
380 </VarListEntry>
381 </VariableList>
382 </RefSect1>
383
384 <RefSect1><Title>Debug Options</>
385 <para>
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.
393 </RefSect1>
394
395 <RefSect1><Title>Examples</>
396 <para>
397 &configureindex; contains a
398 sample configuration file showing the default values for all possible
399 options.
400 </RefSect1>
401
402 <RefSect1><Title>Files</>
403 <para>
404 <filename>/etc/apt/apt.conf</>
405 </RefSect1>
406
407 <RefSect1><Title>See Also</>
408 <para>
409 &apt-cache;, &apt-config;<!-- ? reading apt.conf -->, &apt-preferences;.
410 </RefSect1>
411
412 &manbugs;
413 &manauthor;
414
415 </refentry>