sources.list.5.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. <?xml version="1.0" encoding="utf-8" standalone="no"?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % aptent SYSTEM "apt.ent"> %aptent;
  5. <!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent"> %aptverbatiment;
  6. <!ENTITY % aptvendor SYSTEM "apt-vendor.ent"> %aptvendor;
  7. ]>
  8. <refentry>
  9. <refentryinfo>
  10. &apt-author.jgunthorpe;
  11. &apt-author.team;
  12. &apt-email;
  13. &apt-product;
  14. <!-- The last update date -->
  15. <date>2014-01-18T00:00:00Z</date>
  16. </refentryinfo>
  17. <refmeta>
  18. <refentrytitle>sources.list</refentrytitle>
  19. <manvolnum>5</manvolnum>
  20. <refmiscinfo class="manual">APT</refmiscinfo>
  21. </refmeta>
  22. <!-- Man page title -->
  23. <refnamediv>
  24. <refname>sources.list</refname>
  25. <refpurpose>List of configured APT data sources</refpurpose>
  26. </refnamediv>
  27. <refsect1><title>Description</title>
  28. <para>
  29. The source list <filename>/etc/apt/sources.list</filename> and the the
  30. files contained in <filename>/etc/apt/sources.list.d/</filename> are
  31. designed to support any number of active sources and a variety of source
  32. media. The files list one source per line (one line style) or contain multiline
  33. stanzas defining one or more sources per stanza (deb822 style), with the
  34. most preferred source listed first. The information available from the
  35. configured sources is acquired by <command>apt-get update</command> (or
  36. by an equivalent command from another APT front-end).
  37. </para>
  38. </refsect1>
  39. <refsect1><title>sources.list.d</title>
  40. <para>The <filename>/etc/apt/sources.list.d</filename> directory provides
  41. a way to add sources.list entries in separate files.
  42. Two different file formats are allowed as described in the next two sections.
  43. Filenames need to have either the extension <filename>.list</filename> or
  44. <filename>.sources</filename> depending on the contained format.
  45. The filenames may only contain letters (a-z and A-Z),
  46. digits (0-9), underscore (_), hyphen (-) and period (.) characters.
  47. Otherwise APT will print a notice that it has ignored a file, unless that
  48. file matches a pattern in the <literal>Dir::Ignore-Files-Silently</literal>
  49. configuration list - in which case it will be silently ignored.</para>
  50. </refsect1>
  51. <refsect1><title>one line style format</title>
  52. <para>
  53. Files in this format have the extension <filename>.list</filename>.
  54. Each line specifying a source starts with a type (e.g. <literal>deb-src</literal>)
  55. followed by options and arguments for this type.
  56. Individual entries cannot be continued onto a following line. Empty lines
  57. are ignored, and a <literal>#</literal> character anywhere on a line marks
  58. the remainder of that line as a comment. Consequently an entry can be
  59. disabled by commenting out the entire line.
  60. If options should be provided they are separated by spaces and all of
  61. them together are enclosed by square brackets (<literal>[]</literal>)
  62. included in the line after the type separated from it with a space.
  63. If an option allows multiple values these are separated from each other
  64. with a comma (<literal>,</literal>). An option name is separated from its
  65. value(s) by a equal sign (<literal>=</literal>). Multivalue options have
  66. also <literal>-=</literal> and <literal>+=</literal> as separator which
  67. instead of replacing the default with the given value(s) modify the default
  68. value(s) to remove or include the given values.
  69. </para><para>
  70. This is the traditional format and supported by all apt versions.
  71. Note that not all options as described below are supported by all apt versions.
  72. Note also that some older applications parsing this format on its own might not
  73. expect to encounter options as they were uncommon before the introduction of
  74. multi-architecture support.
  75. </para>
  76. </refsect1>
  77. <refsect1><title>deb822 style format</title>
  78. <para>
  79. Files in this format have the extension <filename>.sources</filename>.
  80. The format is similar in syntax to other files used by Debian and its
  81. derivatives, like the metadata itself apt will download from the configured
  82. sources or the <filename>debian/control</filename> file in a Debian source package.
  83. Individual entries are separated by an empty line, additional empty
  84. lines are ignored, and a <literal>#</literal> character at the start of
  85. the line marks the entire line as a comment. An entry can hence be
  86. disabled by commenting out each line belonging to the stanza, but it is
  87. usually easier to add the field "Enabled: no" to the stanza to disable
  88. the entry. Removing the field or setting it to yes reenables it.
  89. Options have the same syntax as every other field: A fieldname separated by
  90. a colon (<literal>:</literal>) and optionally spaces from its value(s).
  91. Note especially that multiple values are separated by spaces, not by
  92. commas as in the one line format. Multivalue fields like <literal>Architectures</literal>
  93. also have <literal>Architectures-Add</literal> and <literal>Architectures-Remove</literal>
  94. to modify the default value rather than replacing it.
  95. </para><para>
  96. This is a new format supported by apt itself since version 1.1. Previous
  97. versions ignore such files with a notice message as described earlier.
  98. It is intended to make this format gradually the default format and
  99. deprecating the previously described one line style format as it is
  100. easier to create, extend and modify by humans and machines alike
  101. especially if a lot of sources and/or options are involved.
  102. Developers who are working with and/or parsing apt sources are highly
  103. encouraged to add support for this format and to contact the APT team
  104. to coordinate and share this work. Users can freely adopt this format
  105. already, but could encounter problems with software not supporting
  106. the format yet.
  107. </para>
  108. </refsect1>
  109. <refsect1><title>The deb and deb-src types: General Format</title>
  110. <para>The <literal>deb</literal> type references a typical two-level Debian
  111. archive, <filename>distribution/component</filename>. The
  112. <literal>distribution</literal> is generally a suite name like
  113. <literal>stable</literal> or <literal>testing</literal> or a codename like
  114. <literal>&stable-codename;</literal> or <literal>&testing-codename;</literal>
  115. while component is one of <literal>main</literal>, <literal>contrib</literal> or
  116. <literal>non-free</literal>. The
  117. <literal>deb-src</literal> type references a Debian distribution's source
  118. code in the same form as the <literal>deb</literal> type.
  119. A <literal>deb-src</literal> line is required to fetch source indexes.</para>
  120. <para>The format for two one line style entries using the
  121. <literal>deb</literal> and <literal>deb-src</literal> types is:</para>
  122. <literallayout>deb [ option1=value1 option2=value2 ] uri suite [component1] [component2] [...]
  123. deb-src [ option1=value1 option2=value2 ] uri suite [component1] [component2] [...]</literallayout>
  124. <para>Alternatively the equivalent entry in deb822 style looks like this:
  125. <literallayout>
  126. Types: deb deb-src
  127. URIs: uri
  128. Suites: suite
  129. Components: [component1] [component2] [...]
  130. option1: value1
  131. option2: value2
  132. </literallayout>
  133. </para>
  134. <para>The URI for the <literal>deb</literal> type must specify the base of the
  135. Debian distribution, from which APT will find the information it needs.
  136. <literal>suite</literal> can specify an exact path, in which case the
  137. components must be omitted and <literal>suite</literal> must end with
  138. a slash (<literal>/</literal>). This is useful for the case when only a
  139. particular sub-directory of the archive denoted by the URI is of interest.
  140. If <literal>suite</literal> does not specify an exact path, at least
  141. one <literal>component</literal> must be present.</para>
  142. <para><literal>suite</literal> may also contain a variable,
  143. <literal>$(ARCH)</literal>
  144. which expands to the Debian architecture (such as <literal>amd64</literal> or
  145. <literal>armel</literal>) used on the system. This permits architecture-independent
  146. <filename>sources.list</filename> files to be used. In general this is only
  147. of interest when specifying an exact path, <literal>APT</literal> will
  148. automatically generate a URI with the current architecture otherwise.</para>
  149. <para>Especially in the one line style format since only one distribution
  150. can be specified per line it may be necessary to have multiple lines for
  151. the same URI, if a subset of all available distributions or components at
  152. that location is desired. APT will sort the URI list after it has
  153. generated a complete set internally, and will collapse multiple
  154. references to the same Internet host, for instance, into a single
  155. connection, so that it does not inefficiently establish a
  156. connection, close it, do something else, and then re-establish a
  157. connection to that same host. APT also parallelizes connections to
  158. different hosts to more effectively deal with sites with low
  159. bandwidth.</para>
  160. <para>It is important to list sources in order of preference, with the most
  161. preferred source listed first. Typically this will result in sorting
  162. by speed from fastest to slowest (CD-ROM followed by hosts on a local
  163. network, followed by distant Internet hosts, for example).</para>
  164. <para>As an example, the sources for your distribution could look like this
  165. in one line style format:
  166. <literallayout>&sourceslist-list-format;</literallayout> or like this in
  167. deb822 style format:
  168. <literallayout>&sourceslist-sources-format;</literallayout></para>
  169. </refsect1>
  170. <refsect1><title>The deb and deb-src types: Options</title>
  171. <para>Each source entry can have options specified modifying which and how
  172. the source is accessed and data acquired from it. Format, syntax and names
  173. of the options varies between the two formats one line and deb822 style
  174. as described, but they have both the same options available. For simplicity
  175. we list the deb822 fieldname and provide the one line name in brackets.
  176. Remember that beside setting multivalue options explicitly, there is also
  177. the option to modify them based on the default, but we aren't listing those
  178. names explicitly here. Unsupported options are silently ignored by all
  179. APT versions.
  180. <itemizedlist>
  181. <listitem><para><option>Architectures</option>
  182. (<option>arch</option>) is a multivalue option defining for
  183. which architectures information should be downloaded. If this
  184. option isn't set the default is all architectures as defined by
  185. the <option>APT::Architectures</option> config option.
  186. </para></listitem>
  187. <listitem><para><option>Languages</option>
  188. (<option>lang</option>) is a multivalue option defining for
  189. which languages information like translated package
  190. descriptions should be downloaded. If this option isn't set
  191. the default is all languages as defined by the
  192. <option>Acquire::Languages</option> config option.
  193. </para></listitem>
  194. <listitem><para><option>Targets</option>
  195. (<option>target</option>) is a multivalue option defining
  196. which download targets apt will try to acquire from this
  197. source. If not specified, the default set is defined by the
  198. <option>APT::Acquire::Targets</option> configuration scope.
  199. </para></listitem>
  200. </itemizedlist>
  201. Further more, there are options which if set effect
  202. <emphasis>all</emphasis> sources with the same URI and Suite, so they
  203. have to be set on all such entries and can not be varied between
  204. different components. APT will try to detect and error out on such
  205. anomalies.
  206. <itemizedlist>
  207. <listitem><para><option>Signed-By</option> (<option>signed-by</option>)
  208. is either an absolute path to a keyring file (has to be
  209. accessible and readable for the <literal>_apt</literal> user,
  210. so ensure everyone has read-permissions on the file) or a
  211. fingerprint of a key in either the
  212. <filename>trusted.gpg</filename> keyring or in one of the
  213. keyrings in the <filename>trusted.gpg.d/</filename> directory
  214. (see <command>apt-key fingerprint</command>). If the option is
  215. set only the key(s) in this keyring or only the key with this
  216. fingerprint is used for the &apt-secure; verification of this
  217. repository. Otherwise all keys in the trusted keyrings are
  218. considered valid signers for this repository.
  219. </para></listitem>
  220. <listitem><para><option>Check-Valid-Until</option> (<option>check-valid-until</option>)
  221. is a yes/no value which controls if APT should try to detect
  222. replay attacks. A repository creator can declare until then the
  223. data provided in the repository should be considered valid and
  224. if this time is reached, but no new data is provided the data
  225. is considered expired and an error is raised. Beside
  226. increasing security as a malicious attacker can't sent old data
  227. forever denying a user to be able to upgrade to a new version,
  228. this also helps users identify mirrors which are no longer
  229. updated. Some repositories like historic archives aren't
  230. updated anymore by design through, so this check can be
  231. disabled by setting this option to <literal>no</literal>.
  232. Defaults to the value of configuration option
  233. <option>Acquire::Check-Valid-Until</option> which itself
  234. defaults to <literal>yes</literal>.
  235. </para></listitem>
  236. <listitem><para><option>Valid-Until-Min</option>
  237. (<option>check-valid-min</option>) and
  238. <option>Valid-Until-Max</option>
  239. (<option>valid-until-max</option>) can be used to raise or
  240. lower the time period in seconds in which the data from this
  241. repository is considered valid. -Max can be especially useful
  242. if the repository provides no Valid-Until field on its Release
  243. file to set your own value, while -Min can be used to increase
  244. the valid time on seldomly updated (local) mirrors of a more
  245. frequently updated but less accessible archive (which is in the
  246. sources.list as well) instead of disabling the check entirely.
  247. Default to the value of the configuration options
  248. <option>Acquire::Min-ValidTime</option> and
  249. <option>Acquire::Max-ValidTime</option> which are both unset by
  250. default.
  251. </para></listitem>
  252. </itemizedlist>
  253. </para>
  254. </refsect1>
  255. <refsect1><title>URI specification</title>
  256. <para>The currently recognized URI types are:
  257. <variablelist>
  258. <varlistentry><term><command>file</command></term>
  259. <listitem><para>
  260. The file scheme allows an arbitrary directory in the file system to be
  261. considered an archive. This is useful for NFS mounts and local mirrors or
  262. archives.</para></listitem>
  263. </varlistentry>
  264. <varlistentry><term><command>cdrom</command></term>
  265. <listitem><para>
  266. The cdrom scheme allows APT to use a local CD-ROM drive with media
  267. swapping. Use the &apt-cdrom; program to create cdrom entries in the
  268. source list.</para></listitem>
  269. </varlistentry>
  270. <varlistentry><term><command>http</command></term>
  271. <listitem><para>
  272. The http scheme specifies an HTTP server for the archive. If an environment
  273. variable <envar>http_proxy</envar> is set with the format
  274. http://server:port/, the proxy server specified in
  275. <envar>http_proxy</envar> will be used. Users of authenticated
  276. HTTP/1.1 proxies may use a string of the format
  277. http://user:pass@server:port/.
  278. Note that this is an insecure method of authentication.</para></listitem>
  279. </varlistentry>
  280. <varlistentry><term><command>ftp</command></term>
  281. <listitem><para>
  282. The ftp scheme specifies an FTP server for the archive. APT's FTP behavior
  283. is highly configurable; for more information see the
  284. &apt-conf; manual page. Please note that an FTP proxy can be specified
  285. by using the <envar>ftp_proxy</envar> environment variable. It is possible
  286. to specify an HTTP proxy (HTTP proxy servers often understand FTP URLs)
  287. using this environment variable and <emphasis>only</emphasis> this
  288. environment variable. Proxies using HTTP specified in
  289. the configuration file will be ignored.</para></listitem>
  290. </varlistentry>
  291. <varlistentry><term><command>copy</command></term>
  292. <listitem><para>
  293. The copy scheme is identical to the file scheme except that packages are
  294. copied into the cache directory instead of used directly at their location.
  295. This is useful for people using removable media to copy files around with APT.</para></listitem>
  296. </varlistentry>
  297. <varlistentry><term><command>rsh</command></term><term><command>ssh</command></term>
  298. <listitem><para>
  299. The rsh/ssh method invokes RSH/SSH to connect to a remote host and
  300. access the files as a given user. Prior configuration of rhosts or RSA keys
  301. is recommended. The standard <command>find</command> and <command>dd</command>
  302. commands are used to perform the file transfers from the remote host.
  303. </para></listitem>
  304. </varlistentry>
  305. <varlistentry><term>adding more recognizable URI types</term>
  306. <listitem><para>
  307. APT can be extended with more methods shipped in other optional packages, which should
  308. follow the naming scheme <package>apt-transport-<replaceable>method</replaceable></package>.
  309. For instance, the APT team also maintains the package <package>apt-transport-https</package>,
  310. which provides access methods for HTTPS URIs with features similar to the http method.
  311. Methods for using e.g. debtorrent are also available - see &apt-transport-debtorrent;.
  312. </para></listitem>
  313. </varlistentry>
  314. </variablelist>
  315. </para>
  316. </refsect1>
  317. <refsect1><title>Examples</title>
  318. <para>Uses the archive stored locally (or NFS mounted) at /home/apt/debian
  319. for stable/main, stable/contrib, and stable/non-free.</para>
  320. <literallayout>deb file:/home/apt/debian stable main contrib non-free</literallayout>
  321. <literallayout>Types: deb
  322. URIs: file:/home/apt/debian
  323. Suites: stable
  324. Components: main contrib non-free</literallayout>
  325. <para>As above, except this uses the unstable (development) distribution.</para>
  326. <literallayout>deb file:/home/apt/debian unstable main contrib non-free</literallayout>
  327. <literallayout>Types: deb
  328. URIs: file:/home/apt/debian
  329. Suites: unstable
  330. Components: main contrib non-free</literallayout>
  331. <para>Source line for the above</para>
  332. <literallayout>deb-src file:/home/apt/debian unstable main contrib non-free</literallayout>
  333. <literallayout>Types: deb-src
  334. URIs: file:/home/apt/debian
  335. Suites: unstable
  336. Components: main contrib non-free</literallayout>
  337. <para>The first line gets package information for the architectures in <literal>APT::Architectures</literal>
  338. while the second always retrieves <literal>amd64</literal> and <literal>armel</literal>.</para>
  339. <literallayout>deb http://httpredir.debian.org/debian &stable-codename; main
  340. deb [ arch=amd64,armel ] http://httpredir.debian.org/debian &stable-codename; main</literallayout>
  341. <literallayout>Types: deb
  342. URIs: http://httpredir.debian.org/debian
  343. Suites: &stable-codename;
  344. Components: main
  345. Types: deb
  346. URIs: http://httpredir.debian.org/debian
  347. Suites: &stable-codename;
  348. Components: main
  349. Architectures: amd64 armel
  350. </literallayout>
  351. <para>Uses HTTP to access the archive at archive.debian.org, and uses only
  352. the hamm/main area.</para>
  353. <literallayout>deb http://archive.debian.org/debian-archive hamm main</literallayout>
  354. <literallayout>Types: deb
  355. URIs: http://archive.debian.org/debian-archive
  356. Suites: hamm
  357. Components: main</literallayout>
  358. <para>Uses FTP to access the archive at ftp.debian.org, under the debian
  359. directory, and uses only the &stable-codename;/contrib area.</para>
  360. <literallayout>deb ftp://ftp.debian.org/debian &stable-codename; contrib</literallayout>
  361. <literallayout>Types: deb
  362. URIs: ftp://ftp.debian.org/debian
  363. Suites: &stable-codename;
  364. Components: contrib</literallayout>
  365. <para>Uses FTP to access the archive at ftp.debian.org, under the debian
  366. directory, and uses only the unstable/contrib area. If this line appears as
  367. well as the one in the previous example in <filename>sources.list</filename>
  368. a single FTP session will be used for both resource lines.</para>
  369. <literallayout>deb ftp://ftp.debian.org/debian unstable contrib</literallayout>
  370. <literallayout>Types: deb
  371. URIs: ftp://ftp.debian.org/debian
  372. Suites: unstable
  373. Components: contrib</literallayout>
  374. <para>Uses HTTP to access the archive at ftp.tlh.debian.org, under the
  375. universe directory, and uses only files found under
  376. <filename>unstable/binary-i386</filename> on i386 machines,
  377. <filename>unstable/binary-amd64</filename> on amd64, and so
  378. forth for other supported architectures. [Note this example only
  379. illustrates how to use the substitution variable; official debian
  380. archives are not structured like this]
  381. <literallayout>deb http://ftp.tlh.debian.org/universe unstable/binary-$(ARCH)/</literallayout>
  382. <literallayout>Types: deb
  383. URIs: http://ftp.tlh.debian.org/universe
  384. Suites: unstable/binary-$(ARCH)/</literallayout>
  385. </para>
  386. <para>Uses HTTP to get binary packages as well as sources from the stable, testing and unstable
  387. suites and the components main and contrib.</para>
  388. <literallayout>deb http://httpredir.debian.org/debian stable main contrib
  389. deb-src http://httpredir.debian.org/debian stable main contrib
  390. deb http://httpredir.debian.org/debian testing main contrib
  391. deb-src http://httpredir.debian.org/debian testing main contrib
  392. deb http://httpredir.debian.org/debian unstable main contrib
  393. deb-src http://httpredir.debian.org/debian unstable main contrib</literallayout>
  394. <literallayout>Types: deb deb-src
  395. URIs: http://httpredir.debian.org/debian
  396. Suites: stable testing unstable
  397. Components: main contrib
  398. </literallayout>
  399. </refsect1>
  400. <refsect1><title>See Also</title>
  401. <para>&apt-get;, &apt-conf;
  402. </para>
  403. </refsect1>
  404. &manbugs;
  405. </refentry>