apt.conf.5.sgml 18 KB

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