apt.conf.5.sgml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  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>Configuratoin 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 behavoir 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 options 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 pacakge
  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>Get</Term>
  116. <ListItem><Para>
  117. The Get subsection controls the &apt-get; tool, please see its
  118. documentation for more information about the options here.
  119. </VarListEntry>
  120. <VarListEntry><Term>Cache</Term>
  121. <ListItem><Para>
  122. The Cache subsection controls the &apt-cache; tool, please see its
  123. documentation for more information about the options here.
  124. </VarListEntry>
  125. <VarListEntry><Term>CDROM</Term>
  126. <ListItem><Para>
  127. The CDROM subsection controls the &apt-cdrom; tool, please see its
  128. documentation for more information about the options here.
  129. </VarListEntry>
  130. </VariableList>
  131. </RefSect1>
  132. <RefSect1><Title>The Acquire Group</>
  133. <para>
  134. The <literal/Acquire/ group of options controls the download of packages
  135. and the URI handlers.
  136. <VariableList>
  137. <VarListEntry><Term>Queue-Mode</Term>
  138. <ListItem><Para>
  139. Queuing mode; <literal/Queue-Mode/ can be one of <literal/host/ or
  140. <literal/access/ which determins how APT parallelizes outgoing
  141. connections. <literal/host/ means that one connection per target host
  142. will be opened, <literal/access/ means that one connection per URI type
  143. will be opened.
  144. </VarListEntry>
  145. <VarListEntry><Term>Retries</Term>
  146. <ListItem><Para>
  147. Number of retries to perform. If this is non-zero APT will retry failed
  148. files the given number of times.
  149. </VarListEntry>
  150. <VarListEntry><Term>Source-Symlinks</Term>
  151. <ListItem><Para>
  152. Use symlinks for source archives. If set to true then source archives will
  153. be symlinked when possible instead of copying. True is the default
  154. </VarListEntry>
  155. <VarListEntry><Term>http</Term>
  156. <ListItem><Para>
  157. HTTP URIs; http::Proxy is the default http proxy to use. It is in the
  158. standard form of <literal>http://[[user][:pass]@]host[:port]/</>. Per
  159. host proxies can also be specified by using the form
  160. <literal/http::Proxy::&lt;host&gt;/ with the special keyword <literal/DIRECT/
  161. meaning to use no proxies. The <envar/http_proxy/ environment variable
  162. will override all settings.
  163. <para>
  164. Three settings are provided for cache control with HTTP/1.1 complient
  165. proxy caches. <literal/No-Cache/ tells the proxy to not used its cached
  166. response under any circumstances, <literal/Max-Age/ is sent only for
  167. index files and tells the cache to refresh its object if it is older than
  168. the given number of seconds. Debian updates its index files daily so the
  169. default is 1 day. <literal/No-Store/ specifies that the cache should never
  170. store this request, it is only set for archive files. This may be useful
  171. to prevent polluting a proxy cache with very large .deb files. Note:
  172. Squid 2.0.2 does not support any of these options.
  173. <para>
  174. The option <literal/timeout/ sets the timeout timer used by the method,
  175. this applies to all things including connection timeout and data timeout.
  176. <para>
  177. One setting is provided to control the pipeline depth in cases where the
  178. remote server is not RFC conforming or buggy (such as Squid 2.0.2)
  179. <literal/Acquire::http::Pipeline-Depth/ can be a value from 0 to 5
  180. indicating how many outstanding requests APT should send. A value of
  181. zero MUST be specified if the remote host does not properly linger
  182. on TCP connections - otherwise data corruption will occure. Hosts which
  183. require this are in violation of RFC 2068.
  184. </VarListEntry>
  185. <VarListEntry><Term>ftp</Term>
  186. <ListItem><Para>
  187. FTP URis; ftp::Proxy is the default proxy server to use. It is in the
  188. standard form of <literal>ftp://[[user][:pass]@]host[:port]/</> and is
  189. overriden by the <envar/ftp_proxy/ environment variable. To use a ftp
  190. proxy you will have to set the <literal/ftp::ProxyLogin/ script in the
  191. configuration file. This entry specifies the commands to send to tell
  192. the proxy server what to connect to. Please see
  193. &configureindex; for an example of
  194. how to do this. The subsitution variables available are
  195. <literal/$(PROXY_USER)/, <literal/$(PROXY_PASS)/, <literal/$(SITE_USER)/,
  196. <literal/$(SITE_PASS)/, <literal/$(SITE)/, and <literal/$(SITE_PORT)/.
  197. Each is taken from it's respective URI component.
  198. <para>
  199. The option <literal/timeout/ sets the timeout timer used by the method,
  200. this applies to all things including connection timeout and data timeout.
  201. <para>
  202. Several settings are provided to control passive mode. Generally it is
  203. safe to leave passive mode on, it works in nearly every environment.
  204. However some situations require that passive mode be disabled and port
  205. mode ftp used instead. This can be done globally, for connections that
  206. go through a proxy or for a specific host (See the sample config file
  207. for examples)
  208. <para>
  209. It is possible to proxy FTP over HTTP by setting the <envar/ftp_proxy/
  210. environment variable to a http url - see the discussion of the http method
  211. above for syntax. You cannot set this in the configuration file and it is
  212. not recommended to use FTP over HTTP due to its low efficiency.
  213. <para>
  214. The setting <literal/ForceExtended/ controls the use of RFC2428
  215. <literal/EPSV/ and <literal/EPRT/ commands. The defaut is false, which means
  216. these commands are only used if the control connection is IPv6. Setting this
  217. to true forces their use even on IPv4 connections. Note that most FTP servers
  218. do not support RFC2428.
  219. </VarListEntry>
  220. <VarListEntry><Term>cdrom</Term>
  221. <ListItem><Para>
  222. CDROM URIs; the only setting for CDROM URIs is the mount point,
  223. <literal/cdrom::Mount/ which must be the mount point for the CDROM drive
  224. as specified in <filename>/etc/fstab</>. It is possible to provide
  225. alternate mount and unmount commands if your mount point cannot be listed
  226. in the fstab (such as an SMB mount and old mount packages). The syntax
  227. is to put <literallayout>"/cdrom/"::Mount "foo";</literallayout> within
  228. the cdrom block. It is important to have the trailing slash. Unmount
  229. commands can be specified using UMount.
  230. </VarListEntry>
  231. </VariableList>
  232. </RefSect1>
  233. <RefSect1><Title>Directories</>
  234. <para>
  235. The <literal/Dir::State/ section has directories that pertain to local
  236. state information. <literal/lists/ is the directory to place downloaded
  237. package lists in and <literal/status/ is the name of the dpkg status file.
  238. <literal/preferences/ is the name of the APT preferencse file.
  239. <literal/Dir::State/ contains the default directory to prefix on all sub
  240. items if they do not start with <filename>/</> or <filename>./</>.
  241. <para>
  242. <literal/Dir::Cache/ contains locations pertaining to local cache
  243. information, such as the two package caches <literal/srcpkgcache/ and
  244. <literal/pkgcache/ as well as the location to place downloaded archives,
  245. <literal/Dir::Cache::archives/. Generation of caches can be turned off
  246. by setting their names to be blank. This will slow down startup but
  247. save disk space. It is probably prefered to turn off the pkgcache rather
  248. than the srcpkgcache. Like <literal/Dir::State/ the default
  249. directory is contained in <literal/Dir::Cache/
  250. <para>
  251. <literal/Dir::Etc/ contains the location of configuration files,
  252. <literal/sourcelist/ gives the location of the sourcelist and
  253. <literal/main/ is the default configuration file (setting has no effect,
  254. unless it is done from the config file specified by
  255. <envar/APT_CONFIG/).
  256. <para>
  257. The <literal/Dir::Parts/ setting reads in all the config fragments in
  258. lexical order from the directory specified. After this is done then the
  259. main config file is loaded.
  260. <para>
  261. Binary programs are pointed to by <literal/Dir::Bin/. <literal/methods/
  262. specifies the location of the method handlers and <literal/gzip/,
  263. <literal/dpkg/, <literal/apt-get/, <literal/dpkg-source/,
  264. <literal/dpkg-buildpackage/ and <literal/apt-cache/ specify the location
  265. of the respective programs.
  266. </RefSect1>
  267. <RefSect1><Title>APT in DSelect</>
  268. <para>
  269. When APT is used as a &dselect; method several configuration directives
  270. control the default behavoir. These are in the <literal/DSelect/ section.
  271. <VariableList>
  272. <VarListEntry><Term>Clean</Term>
  273. <ListItem><Para>
  274. Cache Clean mode; this value may be one of always, auto, prompt and never.
  275. always will remove all archives after they have been downloaded while auto
  276. will only remove things that are no longer downloadable (replaced with a
  277. new version for instance)
  278. </VarListEntry>
  279. <VarListEntry><Term>Options</Term>
  280. <ListItem><Para>
  281. The contents of this variable is passed to &apt-get; as command line
  282. options when it is run for the install phase.
  283. </VarListEntry>
  284. <VarListEntry><Term>UpdateOptions</Term>
  285. <ListItem><Para>
  286. The contents of this variable is passed to &apt-get; as command line
  287. options when it is run for the update phase.
  288. </VarListEntry>
  289. <VarListEntry><Term>PromptAfterUpdate</Term>
  290. <ListItem><Para>
  291. If true the [U]pdate operation in &dselect; will always prompt to continue.
  292. The default is to prompt only on error.
  293. </VarListEntry>
  294. </VariableList>
  295. </RefSect1>
  296. <RefSect1><Title>How APT calls dpkg</>
  297. <para>
  298. Several configuration directives control how APT invokes &dpkg;. These are
  299. in the <literal/DPkg/ section.
  300. <VariableList>
  301. <VarListEntry><Term>Options</Term>
  302. <ListItem><Para>
  303. This is a list of options to pass to dpkg. The options must be specified
  304. using the list notation and each list item is passed as a single arugment
  305. to &dpkg;.
  306. </VarListEntry>
  307. <VarListEntry><Term>Pre-Invoke</Term><Term>Post-Invoke</Term>
  308. <ListItem><Para>
  309. This is a list of shell commands to run before/after invoking &dpkg;.
  310. Like <literal/Options/ this must be specified in list notation. The
  311. commands are invoked in order using <filename>/bin/sh</>, should any
  312. fail APT will abort.
  313. </VarListEntry>
  314. <VarListEntry><Term>Pre-Install-Pkgs</Term>
  315. <ListItem><Para>
  316. This is a list of shell commands to run before invoking dpkg. Like
  317. <literal/Options/ this must be specified in list notation. The commands
  318. are invoked in order using <filename>/bin/sh</>, should any fail APT
  319. will abort. APT will pass to the commands on standard input the
  320. filenames of all .deb files it is going to install, one per line.
  321. <para>
  322. Version 2 of this protocol dumps more information, including the
  323. protocol version, the APT configuration space and the packages, files
  324. and versions being changed. Version 2 is enabled by setting
  325. <literal/DPkg::Tools::Options::cmd::Version/ to 2. <literal/cmd/ is a
  326. command given to <literal/Pre-Install-Pkgs/.
  327. </VarListEntry>
  328. <VarListEntry><Term>Run-Directory</Term>
  329. <ListItem><Para>
  330. APT chdirs to this directory before invoking dpkg, the default is
  331. <filename>/</>.
  332. </VarListEntry>
  333. <VarListEntry><Term>Build-Options</Term>
  334. <ListItem><Para>
  335. These options are passed to &dpkg-buildpackage; when compiling packages,
  336. the default is to disable signing and produce all binaries.
  337. </VarListEntry>
  338. </VariableList>
  339. </RefSect1>
  340. <RefSect1><Title>Debug Options</>
  341. <para>
  342. Most of the options in the <literal/debug/ section are not interesting to
  343. the normal user, however <literal/Debug::pkgProblemResolver/ shows
  344. interesting output about the decisions dist-upgrade makes.
  345. <literal/Debug::NoLocking/ disables file locking so APT can do some
  346. operations as non-root and <literal/Debug::pkgDPkgPM/ will print out the
  347. command line for each dpkg invokation. <literal/Debug::IdentCdrom/ will
  348. disable the inclusion of statfs data in CDROM IDs.
  349. </RefSect1>
  350. <RefSect1><Title>Examples</>
  351. <para>
  352. &configureindex; contains a
  353. sample configuration file showing the default values for all possible
  354. options.
  355. </RefSect1>
  356. <RefSect1><Title>Files</>
  357. <para>
  358. <filename>/etc/apt/apt.conf</>
  359. </RefSect1>
  360. <RefSect1><Title>See Also</>
  361. <para>
  362. &apt-cache; &apt-conf;
  363. </RefSect1>
  364. &manbugs;
  365. &manauthor;
  366. </refentry>