sources.list.5.sgml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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>sources.list</>
  10. <manvolnum>5</>
  11. </refmeta>
  12. <!-- Man page title -->
  13. <refnamediv>
  14. <refname>sources.list</>
  15. <refpurpose>Package resource list for APT</>
  16. </refnamediv>
  17. <RefSect1><Title>Description</>
  18. <para>
  19. The package resource list is used to locate archives of the package
  20. distribution system in use on the system. At this time, this manual page
  21. documents only the packaging system used by the Debian GNU/Linux system.
  22. This control file is located in <filename>/etc/apt/sources.list</>
  23. <para>
  24. The source list is designed to support any number of active sources and a
  25. variety of source media. The file lists one source per line, with the
  26. most preferred source listed first. The format of each line is:
  27. <literal/type uri args/. The first item, <literal/type/, determines the
  28. format for <literal/args/. <literal/uri/ is a Universal Resource Identifier
  29. (URI), which is a superset of the more specific and well-known Universal
  30. Resource Locator, or URL. The rest of the line can be marked as a comment
  31. by using a #.
  32. </RefSect1>
  33. <RefSect1><Title>The deb and deb-src types</>
  34. <para>
  35. The <literal/deb/ type describes a typical two-level Debian archive,
  36. <filename>distribution/component</>. Typically, <literal/distribution/ is
  37. generally one of <literal/stable/, <literal/unstable/, or
  38. <literal/testing/, while component is one of <literal/main/,
  39. <literal/contrib/, <literal/non-free/, or <literal/non-us/. The
  40. <literal/deb-src/ type describes a debian distribution's source code in
  41. the same form as the <literal/deb/ type. A <literal/deb-src/ line is
  42. required to fetch source indexes.
  43. <para>
  44. The format for a <filename/sources.list/ entry using the <literal/deb/
  45. and <literal/deb-src/ types are:
  46. <literallayout>deb uri distribution [component1] [component2] [...]</literallayout>
  47. <para>
  48. The URI for the <literal/deb/ type must specify the base of the Debian
  49. distribution, from which APT will find the information it needs.
  50. <literal/distribution/ can specify an exact path, in which case the
  51. components must be omitted and <literal/distribution/ must end with a
  52. slash (/). This is useful for when only a particular sub-section of the
  53. archive denoted by the URI is of interest. If <literal/distribution/ does
  54. not specify an exact path, at least one <literal/component/ must be present.
  55. <para>
  56. <literal/distribution/ may also contain a variable, <literal/$(ARCH)/,
  57. which expands to the Debian architecture (i386, m68k, powerpc, ...)
  58. used on the system. This permits architecture-independent
  59. <filename/sources.list/ files to be used. In general this is only of
  60. interest when specifying an exact path, <literal/APT/ will automatically
  61. generate a URI with the current architecture otherwise.
  62. <para>
  63. Since only one distribution can be specified per line it may be necessary
  64. to have multiple lines for the same URI, if a subset of all available
  65. distributions or components at that location is desired.
  66. APT will sort the URI list after it has generated a complete set
  67. internally, and will collapse multiple references to the same Internet
  68. host, for instance, into a single connection, so that it does not
  69. inefficiently establish an FTP connection, close it, do something else,
  70. and then re-establish a connection to that same host. This feature is
  71. useful for accessing busy FTP sites with limits on the number of
  72. simultaneous anonymous users. APT also parallelizes connections to
  73. different hosts to more effectively deal with sites with low bandwidth.
  74. <para>
  75. It is important to list sources in order of preference, with the most
  76. preferred source listed first. Typically this will result in sorting
  77. by speed from fastest to slowest (CD-ROM followed by hosts on a local
  78. network, followed by distant Internet hosts, for example).
  79. <para>
  80. Some examples:
  81. <literallayout>
  82. deb http://http.us.debian.org/debian stable main contrib non-free
  83. deb http://http.us.debian.org/debian dists/stable-updates/
  84. </literallayout>
  85. </RefSect1>
  86. <RefSect1><title>URI specification</title>
  87. <para>
  88. The currently recognized URI types are cdrom, file, http, and ftp.
  89. <VariableList>
  90. <VarListEntry><term>file</term>
  91. <ListItem><Para>
  92. The file scheme allows an arbitrary directory in the file system to be
  93. considered an archive. This is useful for NFS mounts and local mirrors or
  94. archives.
  95. </VarListEntry>
  96. <VarListEntry><term>cdrom</term>
  97. <ListItem><Para>
  98. The cdrom scheme allows APT to use a local CDROM drive with media
  99. swapping. Use the &apt-cdrom; program to create cdrom entries in the
  100. source list.
  101. </VarListEntry>
  102. <VarListEntry><term>http</term>
  103. <ListItem><Para>
  104. The http scheme specifies an HTTP server for the archive. If an environment
  105. variable <EnVar/http_proxy/ is set with the format
  106. http://server:port/, the proxy server specified in
  107. <EnVar/http_proxy/ will be used. Users of authenticated HTTP/1.1 proxies
  108. may use a string of the format http://user:pass@server:port/
  109. Note that this is an insecure method of authentication.
  110. </VarListEntry>
  111. <VarListEntry><term>ftp</term>
  112. <ListItem><Para>
  113. The ftp scheme specifies an FTP server for the archive. APT's FTP behavior
  114. is highly configurable; for more information see the
  115. &apt-conf; manual page. Please note that a ftp proxy can be specified
  116. by using the <EnVar/ftp_proxy/ environment variable. It is possible to
  117. specify a http proxy (http proxy servers often understand ftp urls) using
  118. this method and ONLY this method. ftp proxies using http specified in the
  119. configuration file will be ignored.
  120. </VarListEntry>
  121. <VarListEntry><term>copy</term>
  122. <ListItem><Para>
  123. The copy scheme is identical to the file scheme except that packages are
  124. copied into the cache directory instead of used directly at their location.
  125. This is useful for people using a zip disk to copy files around with APT.
  126. </VarListEntry>
  127. <VarListEntry><term>rsh</term><term>ssh</term>
  128. <ListItem><Para>
  129. The rsh/ssh method invokes rsh/ssh to connect to a remote host
  130. as a given user and access the files. No password authentication is
  131. possible, prior arrangements with RSA keys or rhosts must have been made.
  132. Access to files on the remote uses standard <command/find/ and <command/dd/
  133. commands to perform the file transfers from the remote.
  134. </VarListEntry>
  135. </VariableList>
  136. </RefSect1>
  137. <RefSect1><title>Examples</title>
  138. <para>
  139. Uses the archive stored locally (or NFS mounted) at /home/jason/debian
  140. for stable/main, stable/contrib, and stable/non-free.
  141. <literallayout>deb file:/home/jason/debian stable main contrib non-free</literallayout>
  142. <para>
  143. As above, except this uses the unstable (development) distribution.
  144. <literallayout>deb file:/home/jason/debian unstable main contrib non-free</literallayout>
  145. <para>
  146. Source line for the above
  147. <literallayout>deb-src file:/home/jason/debian unstable main contrib non-free</literallayout>
  148. <para>
  149. Uses HTTP to access the archive at archive.debian.org, and uses only the
  150. hamm/main area.
  151. <literallayout>deb http://archive.debian.org/debian-archive hamm main</literallayout>
  152. <para>
  153. Uses FTP to access the archive at ftp.debian.org, under the debian
  154. directory, and uses only the stable/contrib area.
  155. <literallayout>deb ftp://ftp.debian.org/debian stable contrib</literallayout>
  156. <para>
  157. Uses FTP to access the archive at ftp.debian.org, under the debian
  158. directory, and uses only the unstable/contrib area. If this line appears as
  159. well as the one in the previous example in <filename/sources.list/,
  160. a single FTP session will be used for both resource lines.
  161. <literallayout>deb ftp://ftp.debian.org/debian unstable contrib</literallayout>
  162. <para>
  163. Uses HTTP to access the archive at nonus.debian.org, under the debian-non-US
  164. directory.
  165. <literallayout>deb http://nonus.debian.org/debian-non-US stable/non-US main contrib non-free</literallayout>
  166. <para>
  167. Uses HTTP to access the archive at nonus.debian.org, under the
  168. debian-non-US directory, and uses only files found under
  169. <filename>unstable/binary-i386</> on i386 machines,
  170. <filename>unstable/binary-m68k</> on m68k, and so
  171. forth for other supported architectures. [Note this example only
  172. illustrates how to use the substitution variable; non-us is no longer
  173. structured like this]
  174. <literallayout>deb http://ftp.de.debian.org/debian-non-US unstable/binary-$(ARCH)/</literallayout>
  175. </RefSect1>
  176. <RefSect1><Title>See Also</>
  177. <para>
  178. &apt-cache; &apt-conf;
  179. </RefSect1>
  180. &manbugs;
  181. &manauthor;
  182. </refentry>