apt.conf.5.sgml 18 KB

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