Fixed help text man page references
[ntk/apt.git] / doc / files.sgml
CommitLineData
578bfd0a
AL
1<!doctype debiandoc system>
2<!-- -*- mode: sgml; mode: fold -*- -->
3<book>
4<title>APT Files</title>
5
6<author>Jason Gunthorpe <email>jgg@debian.org</email></author>
42c90c42 7<version>$Id: files.sgml,v 1.4 1998/12/14 04:00:33 jgg Exp $</version>
578bfd0a
AL
8
9<abstract>
10This document describes the complete implementation and format of the
11installed APT directory structure. It also serves as guide to how APT
12views the Debian archive.
13</abstract>
14
15<copyright>
16Copyright &copy; Jason Gunthorpe, 1998.
17<p>
18"APT" and this document are free software; you can redistribute them and/or
19modify them under the terms of the GNU General Public License as published
20by the Free Software Foundation; either version 2 of the License, or (at your
21option) any later version.
22
23<p>
24For more details, on Debian GNU/Linux systems, see the file
25/usr/doc/copyright/GPL for the full license.
26</copyright>
27
28<toc sect>
29
30<chapt>Introduction
31<!-- General {{{ -->
32<!-- ===================================================================== -->
33<sect>General
34
35<p>
36This document serves two purposes. The first is to document the installed
37directory structure and the format and purpose of each file. The second
38purpose is to document how APT views the Debian archive and deals with
39multiple package files.
40
41<p>
42The var directory structure is as follows:
43<example>
44 /var/state/apt/
45 lists/
46 partial/
47 xstatus
42c90c42
AL
48 userstatus
49 cdroms.list
578bfd0a
AL
50 /var/cache/apt/
51 pkgcache.bin
52 srcpkgcache.bin
53 archives/
54 partial/
55 /etc/apt/
56 sources.list
42c90c42 57 apt.conf
578bfd0a
AL
58 /usr/lib/apt/
59 methods/
60 cdrom
61 ftp
62 http
42c90c42
AL
63 file
64 gzip
65 copy
578bfd0a
AL
66</example>
67
68<p>
69As is specified in the FHS 2.0 /var/state/apt is used for application
70data that is not expected to be user modified. /var/cache/apt is used
71for regeneratable data and is where the package cache and downloaded .debs
72go.
73</sect>
74 <!-- }}} -->
75
76<chapt>Files
77<!-- Distribution Source List {{{ -->
78<!-- ===================================================================== -->
79<sect>Distribution Source list (sources.list)
80
81<p>
82The distribution source list is used to locate archives of the debian
83distribution. It is designed to support any number of active sources and to
84support a mix of source media. The file lists one source per line, with the
85fastest source listed first. The format of each line is:
86
87<p>
42c90c42 88<var>type uri args</var>
578bfd0a
AL
89
90<p>
91The first item, <var>type</var>, indicates the format for the remainder
92of the line. It is designed to indicate the structure of the distribution
93the line is talking about. Currently the only defined value is <em>deb</em>
94which indicates a standard debian archive with a dists dir.
95
96<sect1>The deb Type
97 <p>
98 The <em>deb</em> type is to be a typical two level debian distributions,
99 dist/<var>distribution</var>/<var>component</var>. Typically distribution
100 is one of stable, unstable or frozen while component is one of main,
101 contrib, non-free or non-us. The format for the deb line is as follows:
102
103 <p>
104 deb <var>uri</var> <var>distribution</var> <var>compontent</var>
105 [<var>component</var> ...]
106
107 <p>
108 <var>uri</var> for the <em>deb</em> type must specify the base of the
109 debian distribution. APT will automatically generate the proper longer
fb9ebfdb 110 URIs to get the information it needs. <var>distribution</var> can specify
578bfd0a
AL
111 an exact path, in this case the components must be omitted and
112 <var>distribution</var> must end in a slash.
113
114 <p>
115 Since only one distribution can be specified per deb line it may be
116 necessary to list a number of deb lines for the same URI. APT will
117 sort the URI list after it has generated a complete set to allow
118 connection reuse. It is important to order things in the sourcelist
119 from most prefered to least prefered (fastest to slowest).
120</sect1>
121
122<sect1>URI specification
123<p>
124URIs in the source list support a large number of access schemes.
125
126<taglist>
127<tag>cdrom<item>
128 The cdrom scheme is special in that If Modifed Since queries are never
129 performed and that APT knows how to match a cdrom to the name it
42c90c42
AL
130 was given when first inserted. APT also knows all of the possible
131 mount points the cdrom drives and that the user should be prompted
578bfd0a
AL
132 to insert a CD if it cannot be found. The path is relative to an
133 arbitary mount point (of APT's choosing) and must not start with a
134 slash. The first pathname component is the given name and is purely
135 descriptive and of the users choice. However, if a file in the root of
42c90c42 136 the cdrom is called '.disk/info' its contents will be used instead of
578bfd0a 137 prompting. The name serves as a tag for the cdrom and should be unique.
578bfd0a
AL
138 <example>
139 cdrom:Debian 1.3/debian
140 </example>
141
142<tag>http<item>
143 This scheme specifies a HTTP server for the debian archive. HTTP is prefered
144 over FTP because If Modified Since queries against the Package file are
42c90c42 145 possible as well as deep pipelining and resume capabilities.
578bfd0a
AL
146 <example>
147 http://www.debian.org/archive
148 </example>
149
150<tag>ftp<item>
151 This scheme specifies a FTP connection to the server. FTP is limited because
152 there is no support for IMS and is hard to proxy over firewalls.
153 <example>
154 ftp://ftp.debian.org/debian
155 </example>
156
157<tag>file<item>
158 The file scheme allows an arbitary directory in the file system to be
159 considered as a debian archive. This is usefull for NFS mounts and
160 local mirrors/archives.
161 <example>
162 file:/var/debian
163 </example>
164
578bfd0a
AL
165<tag>smb<item>
166 A possible future expansion may be to have direct support for smb (Samba
167 servers).
168 <example>
169 smb://ftp.kernel.org/pub/mirrors/debian
170 </example>
171</taglist>
172</sect1>
173
174<sect1>Hashing the URI
175<p>
176All permanent information aquired from any of the sources is stored in the
177lists directory. Thus, there must be a way to relate the filename in the
178lists directory to a line in the sourcelist. To simplify things this is
fb9ebfdb
AL
179done by quoting the URI and treating _'s as quoteable characters and
180converting / to _. The URI spec says this is done by converting a
578bfd0a
AL
181sensitive character into %xx where xx is the hexadecimal representation
182from the ascii character set. Examples:
183
184<example>
185http://www.debian.org/archive/dists/stable/binary-i386/Packages
fb9ebfdb 186/var/state/apt/lists/www.debian.org_archive_dists_stable_binary-i386_Packages
578bfd0a
AL
187
188cdrom:Debian 1.3/debian/Packages
fb9ebfdb 189/var/state/apt/info/Debian%201.3_debian_Packages
578bfd0a
AL
190</example>
191
192<p>
193The other alternative that was considered was to use a deep directory
194structure but this poses two problems, it makes it very difficult to prune
195directories back when sources are no longer used and complicates the handling
196of the partial directory. This gives a very simple way to deal with all
0a8e3465
AL
197of the situations that can arise. Also note that the same rules described in
198the <em>Archive Directory</> section regarding the partial sub dir apply
199here as well.
578bfd0a
AL
200</sect1>
201
202</sect>
203 <!-- }}} -->
204<!-- Extra Status {{{ -->
205<!-- ===================================================================== -->
206<sect>Extra Status File (xstatus)
207
208<p>
0a8e3465
AL
209The extra status file serves the same purpose as the normal dpkg status file
210(/var/lib/dpkg/status) except that it stores information unique to apt.
578bfd0a
AL
211This includes the autoflag, target distribution and version and any other
212uniqe features that come up over time. It duplicates nothing from the normal
213dpkg status file. Please see other APT documentation for a discussion
214of the exact internal behavior of these fields. The Package field is
215placed directly before the new fields to indicate which package they
216apply to. The new fields are as follows:
217
218<taglist>
219<tag>X-Auto<item>
220 The Auto flag can be Yes or No and controls whether the package is in
221 auto mode.
222
223<tag>X-TargetDist<item>
224 The TargetDist item indicates which distribution versions are offered for
225 installation from. It should be stable, unstable or frozen.
226
227<tag>X-TargetVersion<item>
228 The target version item is set if the user selects a specific version, it
229 overrides the TargetDist selection if both are present.
230</taglist>
231</sect>
232 <!-- }}} -->
233<!-- Binary Package Cache {{{ -->
234<!-- ===================================================================== -->
235<sect>Binary Package Cache (pkgcache.bin)
236
237<p>
238Please see cache.sgml for a complete description of what this file is. The
239cache file is updated whenever the contents of the lists directory changes.
240If the cache is erased, corrupted or of a non-matching version it will
241be automatically rebuilt by all of the tools that need it.
242<em>srcpkgcache.bin</> contains a cache of all of the package files in the
243source list. This allows regeneration of the cache when the status files
244change to use a prebuilt version for greater speed.
245</sect>
246 <!-- }}} -->
247<!-- Downloads Directory {{{ -->
248<!-- ===================================================================== -->
249<sect>Downloads Directory (archives)
250
251<p>
252The archives directory is where all downloaded .deb archives go. When the
253file transfer is initiated the deb is placed in partial. Once the file
254is fully downloaded and its MD5 hash and size are verifitied it is moved
255from partial into archives/. Any files found in archives/ can be assumed
256to be verified.
257
258<p>
259No dirctory structure is transfered from the receiving site and all .deb
260file names conform to debian conventions. No short (msdos) filename should
261be placed in archives. If the need arises .debs should be unpacked, scanned
262and renamed to their correct internal names. This is mostly to prevent
263file name conflicts but other programs may depend on this if convenient.
264Downloaded .debs must be found in one of the package lists with an exact
265name + version match..
266</sect>
267 <!-- }}} -->
268<!-- The Methods Directory {{{ -->
269<!-- ===================================================================== -->
270<sect> The Methods Directory (/usr/lib/apt/methods)
271
272<p>
0a8e3465
AL
273The Methods directory is more fully described in the APT Methods interface
274document.
578bfd0a
AL
275</sect>
276 <!-- }}} -->
277<!-- The Mirror List {{{ -->
278<!-- ===================================================================== -->
279<sect> The Mirror List
280
281<p>
282The mirror list is stored on the primary debian web server (www.debian.org)
0a8e3465
AL
283and contains a machine readable list of all known debian mirrors. It's
284format and style mirror the Package file.
285
286<taglist>
287<tag>Site<item>
288This is the proper host name of the site. It should not be a host within
289debian.org and generally cnames should be advoided here.
290
291<tag>Aliases<item>
292These list any commonly used aliases for the site. This field is used to make
293sure that a site is not added twice.
294
295<tag>Type<item>
296This field can either be <em>Push-Primary</> or <em>leaf</>.
297<em>Push-Primary</> are authorized top level mirrors of the archive, all
298other mirrors are leaf.
299
300<tag>Archive-[access]<item>
301The Archive field gives the path(s) to the debian archive. [access]
302specifies the access method and may be one of ftp, http, rsync, nfs, or
303smb. For many of the types it is possible to prefix the path with :###
304indicating that an alternate port should be used. Generaly paths
305start with a / and end with a /, rsync is an exception in that the
306first directory component is not a path but a label.
307
308<tag>WWW-[access]<item>
309The WWW field gives the path(s) to the debian web site.
578bfd0a 310
0a8e3465
AL
311<tag>CDImage-[access]<item>
312The WWW field gives the path(s) to the debian CD-ROM images
578bfd0a 313
0a8e3465
AL
314<tag>Incoming-[access]<item>
315The Incoming field gives the path(s) to a mirror of the debian incoming
316directory.
317
318<tag>nonUS-[access]<item>
319The nonUS field gives the path(s) to a mirror of the non-US distribution.
320
321<tag>Maintainer<item>
322This is the email address of the maintainer of the mirror.
323
324<tag>Location<item>
325Location gives the general geographical region the mirror is in.
326
327<tag>Sponsor<item>
328The Sponsor field indicates who owns the mirror and a URL to a web page
329describing the organization.
330
331<tag>Comment<item>
332General free-form text.
333
334</taglist>
578bfd0a
AL
335
336<p>
337Some form of network measurement will have to be used to gauge performance
338of each of the mirrors. This will be discussed later, initial versions
339will use the first found URI.
340</sect>
341 <!-- }}} -->
342<!-- The Release File {{{ -->
343<!-- ===================================================================== -->
344<sect> The Release File
345
346<p>
347This file plays and important role in how APT presents the archive to the
348user. Its main purpose is to present a descriptive name for the source
349of each version of each package. It also is used to detect when new versions
350of debian are released. It augments the package file it is associated with
351by providing meta information about the entire archive which the Packages
352file describes.
353
354<p>
355The full name of the distribution for presentation to the user is formed
356as 'label version archive', with a possible extended name being
357'label version archive component'.
358
359<p>
360The file is formed as the package file (RFC-822) with the following tags
361defined:
362
363<taglist>
364<tag>Archive<item>
365This is the common name we give our archives, such as <em>stable</> or
366<em>unstable</>.
367
368<tag>Component<item>
369Referes to the sub-component of the archive, <em>main</>, <em>contrib</>
370etc.
371
372<tag>Version<item>
373This is a version string with the same properties as in the Packages file.
374It represents the release level of the archive.
375
376<tag>Origin<item>
377This specifies who is providing this archive. In the case of Debian the
378string will read 'Debian'. Other providers may use their own string
379
380<tag>Label<item>
381This carries the encompassing name of the distribution. For Debian proper
382this field reads 'Debian'. For derived distributions it should contain their
383proper name.
384
385<tag>Architecture<item>
386When the archive has packages for a single architecture then the Architecture
387is listed here. If a mixed set of systems are represented then this should
388contain the keyword <em>mixed</em>.
389
390<tag>NotAutomatic<item>
391A Yes/No flag indicating that the archive is extremely unstable and its
392version's should never be automatically selected. This is to be used by
393experimental.
394
395<tag>Description<item>
396Description is used to describe the release. For instance experimental would
397contain a warning that the packages have problems.
398</taglist>
399
400<p>
401The location of the Release file in the archive is very important, it must
402be located in the same location as the packages file so that it can be
403located in all situations. The following is an example for the current stable
404release, 1.3.1r6
405
406<example>
407Archive: stable
408Compontent: main
409Version: 1.3.1r6
410Origin: Debian
411Label: Debian
412Architecture: i386
413</example>
414
415This is an example of experimental,
416<example>
417Archive: experimental
418Version: 0
419Origin: Debian
420Label: Debian
421Architecture: mixed
422NotAutomatic: Yes
423</example>
424
425And unstable,
426<example>
427Archive: unstable
428Compontent: main
429Version: 2.1
430Origin: Debian
431Label: Debian
432Architecture: i386
433</example>
434
435</sect>
436 <!-- }}} -->
437
438</book>