]> git.saurik.com Git - apt.git/blob - doc/sources.list.5.xml
releasing version 0.8.10.2
[apt.git] / doc / sources.list.5.xml
1 <?xml version="1.0" encoding="utf-8" standalone="no"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4
5 <!ENTITY % aptent SYSTEM "apt.ent">
6 %aptent;
7
8 <!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
9 %aptverbatiment;
10
11 ]>
12
13 <refentry>
14
15 <refentryinfo>
16 &apt-author.jgunthorpe;
17 &apt-author.team;
18 &apt-email;
19 &apt-product;
20 <!-- The last update date -->
21 <date>29 February 2004</date>
22 </refentryinfo>
23
24 <refmeta>
25 <refentrytitle>sources.list</refentrytitle>
26 <manvolnum>5</manvolnum>
27 <refmiscinfo class="manual">APT</refmiscinfo>
28 </refmeta>
29
30 <!-- Man page title -->
31 <refnamediv>
32 <refname>sources.list</refname>
33 <refpurpose>Package resource list for APT</refpurpose>
34 </refnamediv>
35
36 <refsect1><title>Description</title>
37 <para>The package resource list is used to locate archives of the package
38 distribution system in use on the system. At this time, this manual page
39 documents only the packaging system used by the Debian GNU/Linux system.
40 This control file is <filename>/etc/apt/sources.list</filename>.</para>
41
42 <para>The source list is designed to support any number of active sources and a
43 variety of source media. The file lists one source per line, with the
44 most preferred source listed first. The format of each line is:
45 <literal>type uri args</literal> The first item, <literal>type</literal>
46 determines the format for <literal>args</literal>. <literal>uri</literal> is
47 a Universal Resource Identifier
48 (URI), which is a superset of the more specific and well-known Universal
49 Resource Locator, or URL. The rest of the line can be marked as a comment
50 by using a #.</para>
51 </refsect1>
52
53 <refsect1><title>sources.list.d</title>
54 <para>The <filename>/etc/apt/sources.list.d</filename> directory provides
55 a way to add sources.list entries in separate files.
56 The format is the same as for the regular <filename>sources.list</filename> file.
57 File names need to end with
58 <filename>.list</filename> and may only contain letters (a-z and A-Z),
59 digits (0-9), underscore (_), hyphen (-) and period (.) characters.
60 Otherwise they will be silently ignored.</para>
61 </refsect1>
62
63 <refsect1><title>The deb and deb-src types</title>
64 <para>The <literal>deb</literal> type describes a typical two-level Debian
65 archive, <filename>distribution/component</filename>. Typically,
66 <literal>distribution</literal> is generally one of
67 <literal>stable</literal> <literal>unstable</literal> or
68 <literal>testing</literal> while component is one of <literal>main</literal>
69 <literal>contrib</literal> <literal>non-free</literal> or
70 <literal>non-us</literal>. The
71 <literal>deb-src</literal> type describes a debian distribution's source
72 code in the same form as the <literal>deb</literal> type.
73 A <literal>deb-src</literal> line is required to fetch source indexes.</para>
74
75
76 <para>The format for a <filename>sources.list</filename> entry using the
77 <literal>deb</literal> and <literal>deb-src</literal> types is:</para>
78
79 <literallayout>deb uri distribution [component1] [component2] [...]</literallayout>
80
81 <para>The URI for the <literal>deb</literal> type must specify the base of the
82 Debian distribution, from which APT will find the information it needs.
83 <literal>distribution</literal> can specify an exact path, in which case the
84 components must be omitted and <literal>distribution</literal> must end with
85 a slash (/). This is useful for when the case only a particular sub-section of the
86 archive denoted by the URI is of interest.
87 If <literal>distribution</literal> does not specify an exact path, at least
88 one <literal>component</literal> must be present.</para>
89
90 <para><literal>distribution</literal> may also contain a variable,
91 <literal>$(ARCH)</literal>
92 which expands to the Debian architecture (i386, m68k, powerpc, ...)
93 used on the system. This permits architecture-independent
94 <filename>sources.list</filename> files to be used. In general this is only
95 of interest when specifying an exact path, <literal>APT</literal> will
96 automatically generate a URI with the current architecture otherwise.</para>
97
98 <para>Since only one distribution can be specified per line it may be necessary
99 to have multiple lines for the same URI, if a subset of all available
100 distributions or components at that location is desired.
101 APT will sort the URI list after it has generated a complete set
102 internally, and will collapse multiple references to the same Internet
103 host, for instance, into a single connection, so that it does not
104 inefficiently establish an FTP connection, close it, do something else,
105 and then re-establish a connection to that same host. This feature is
106 useful for accessing busy FTP sites with limits on the number of
107 simultaneous anonymous users. APT also parallelizes connections to
108 different hosts to more effectively deal with sites with low bandwidth.</para>
109
110 <para>It is important to list sources in order of preference, with the most
111 preferred source listed first. Typically this will result in sorting
112 by speed from fastest to slowest (CD-ROM followed by hosts on a local
113 network, followed by distant Internet hosts, for example).</para>
114
115 <para>Some examples:</para>
116 <literallayout>
117 deb http://ftp.debian.org/debian &stable-codename; main contrib non-free
118 deb http://security.debian.org/ &stable-codename;/updates main contrib non-free
119 </literallayout>
120
121 </refsect1>
122
123 <refsect1><title>URI specification</title>
124
125 <para>The currently recognized URI types are cdrom, file, http, ftp, copy,
126 ssh, rsh.
127 <variablelist>
128 <varlistentry><term>file</term>
129 <listitem><para>
130 The file scheme allows an arbitrary directory in the file system to be
131 considered an archive. This is useful for NFS mounts and local mirrors or
132 archives.</para></listitem>
133 </varlistentry>
134
135 <varlistentry><term>cdrom</term>
136 <listitem><para>
137 The cdrom scheme allows APT to use a local CDROM drive with media
138 swapping. Use the &apt-cdrom; program to create cdrom entries in the
139 source list.</para></listitem>
140 </varlistentry>
141
142 <varlistentry><term>http</term>
143 <listitem><para>
144 The http scheme specifies an HTTP server for the archive. If an environment
145 variable <envar>http_proxy</envar> is set with the format
146 http://server:port/, the proxy server specified in
147 <envar>http_proxy</envar> will be used. Users of authenticated
148 HTTP/1.1 proxies may use a string of the format
149 http://user:pass@server:port/.
150 Note that this is an insecure method of authentication.</para></listitem>
151 </varlistentry>
152
153 <varlistentry><term>ftp</term>
154 <listitem><para>
155 The ftp scheme specifies an FTP server for the archive. APT's FTP behavior
156 is highly configurable; for more information see the
157 &apt-conf; manual page. Please note that a ftp proxy can be specified
158 by using the <envar>ftp_proxy</envar> environment variable. It is possible
159 to specify a http proxy (http proxy servers often understand ftp urls)
160 using this method and ONLY this method. ftp proxies using http specified in
161 the configuration file will be ignored.</para></listitem>
162 </varlistentry>
163
164 <varlistentry><term>copy</term>
165 <listitem><para>
166 The copy scheme is identical to the file scheme except that packages are
167 copied into the cache directory instead of used directly at their location.
168 This is useful for people using a zip disk to copy files around with APT.</para></listitem>
169 </varlistentry>
170
171 <varlistentry><term>rsh</term><term>ssh</term>
172 <listitem><para>
173 The rsh/ssh method invokes rsh/ssh to connect to a remote host
174 as a given user and access the files. It is a good idea to do prior
175 arrangements with RSA keys or rhosts.
176 Access to files on the remote uses standard <command>find</command> and
177 <command>dd</command>
178 commands to perform the file transfers from the remote.</para></listitem>
179 </varlistentry>
180
181 <varlistentry><term>more recognizable URI types</term>
182 <listitem><para>
183 APT can be extended with more methods shipped in other optional packages which should
184 follow the nameing scheme <literal>apt-transport-<replaceable>method</replaceable></literal>.
185 The APT team e.g. maintains also the <literal>apt-transport-https</literal> package which
186 provides access methods for https-URIs with features similar to the http method, but other
187 methods for using e.g. debtorrent are also available, see <citerefentry>
188 <refentrytitle><filename>apt-transport-debtorrent</filename></refentrytitle>
189 <manvolnum>1</manvolnum></citerefentry>.
190 </para></listitem>
191 </varlistentry>
192 </variablelist>
193 </para>
194 </refsect1>
195
196 <refsect1><title>Examples</title>
197 <para>Uses the archive stored locally (or NFS mounted) at /home/jason/debian
198 for stable/main, stable/contrib, and stable/non-free.</para>
199 <literallayout>deb file:/home/jason/debian stable main contrib non-free</literallayout>
200
201 <para>As above, except this uses the unstable (development) distribution.</para>
202 <literallayout>deb file:/home/jason/debian unstable main contrib non-free</literallayout>
203
204 <para>Source line for the above</para>
205 <literallayout>deb-src file:/home/jason/debian unstable main contrib non-free</literallayout>
206
207 <para>Uses HTTP to access the archive at archive.debian.org, and uses only
208 the hamm/main area.</para>
209 <literallayout>deb http://archive.debian.org/debian-archive hamm main</literallayout>
210
211 <para>Uses FTP to access the archive at ftp.debian.org, under the debian
212 directory, and uses only the &stable-codename;/contrib area.</para>
213 <literallayout>deb ftp://ftp.debian.org/debian &stable-codename; contrib</literallayout>
214
215 <para>Uses FTP to access the archive at ftp.debian.org, under the debian
216 directory, and uses only the unstable/contrib area. If this line appears as
217 well as the one in the previous example in <filename>sources.list</filename>
218 a single FTP session will be used for both resource lines.</para>
219 <literallayout>deb ftp://ftp.debian.org/debian unstable contrib</literallayout>
220
221 <para>Uses HTTP to access the archive at nonus.debian.org, under the
222 debian-non-US directory.</para>
223 <literallayout>deb http://nonus.debian.org/debian-non-US stable/non-US main contrib non-free</literallayout>
224
225 <para>Uses HTTP to access the archive at nonus.debian.org, under the
226 debian-non-US directory, and uses only files found under
227 <filename>unstable/binary-i386</filename> on i386 machines,
228 <filename>unstable/binary-m68k</filename> on m68k, and so
229 forth for other supported architectures. [Note this example only
230 illustrates how to use the substitution variable; non-us is no longer
231 structured like this]
232 <literallayout>deb http://ftp.de.debian.org/debian-non-US unstable/binary-$(ARCH)/</literallayout>
233 </para>
234 </refsect1>
235
236 <refsect1><title>See Also</title>
237 <para>&apt-cache; &apt-conf;
238 </para>
239 </refsect1>
240
241 &manbugs;
242
243 </refentry>
244