]> git.saurik.com Git - apt.git/blame - doc/files.sgml
* apt-pkg/contrib/cdromutl.cc:
[apt.git] / doc / files.sgml
CommitLineData
578bfd0a 1<!-- -*- mode: sgml; mode: fold -*- -->
851389e7 2<!doctype debiandoc PUBLIC "-//DebianDoc//DTD DebianDoc//EN">
578bfd0a
AL
3<book>
4<title>APT Files</title>
5
6<author>Jason Gunthorpe <email>jgg@debian.org</email></author>
8835c5d0 7<version>$Id: files.sgml,v 1.12 2003/04/26 23:26:13 doogie 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>
a66a514f 16Copyright &copy; Jason Gunthorpe, 1998-1999.
578bfd0a
AL
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
2926128f 25/usr/share/common-licenses/GPL for the full license.
578bfd0a
AL
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>
b2e465d6 44 /var/lib/apt/
86435b7d 45 lists/
578bfd0a 46 partial/
86435b7d
DK
47 periodic/
48 extended_states
49 cdroms.list
578bfd0a 50 /var/cache/apt/
578bfd0a
AL
51 archives/
52 partial/
86435b7d
DK
53 pkgcache.bin
54 srcpkgcache.bin
578bfd0a 55 /etc/apt/
86435b7d
DK
56 sources.list.d/
57 apt.conf.d/
58 preferences.d/
59 trusted.gpg.d/
60 sources.list
61 apt.conf
62 apt_preferences
63 trusted.gpg
578bfd0a 64 /usr/lib/apt/
86435b7d
DK
65 methods/
66 bzip2
67 cdrom
68 copy
69 file
70 ftp
71 gpgv
72 gzip
73 http
74 https
75 lzma
76 rred
77 rsh
78 ssh
578bfd0a
AL
79</example>
80
81<p>
b2e465d6 82As is specified in the FHS 2.1 /var/lib/apt is used for application
578bfd0a
AL
83data that is not expected to be user modified. /var/cache/apt is used
84for regeneratable data and is where the package cache and downloaded .debs
86435b7d
DK
85go. /etc/apt is the place where configuration should happen and
86/usr/lib/apt is the place where the apt and other packages can place
87binaries which can be used by the acquire system of APT.
578bfd0a
AL
88</sect>
89 <!-- }}} -->
90
91<chapt>Files
92<!-- Distribution Source List {{{ -->
93<!-- ===================================================================== -->
86435b7d
DK
94<sect>Files and fragment directories in /etc/apt
95
96<p>
97All files in /etc/apt are used to modify specific aspects of APT. To enable
98other packages to ship needed configuration herself all these files have
99a fragment directory packages can place their files in instead of mangling
100with the main files. The main files are therefore considered to be only
101used by the user and not by a package. The documentation omits this directories
102most of the time to be easier readable, so every time the documentation includes
103a reference to a main file it really means the file or the fragment directories.
104
105</sect>
106
578bfd0a
AL
107<sect>Distribution Source list (sources.list)
108
109<p>
110The distribution source list is used to locate archives of the debian
111distribution. It is designed to support any number of active sources and to
112support a mix of source media. The file lists one source per line, with the
113fastest source listed first. The format of each line is:
114
115<p>
42c90c42 116<var>type uri args</var>
578bfd0a
AL
117
118<p>
119The first item, <var>type</var>, indicates the format for the remainder
120of the line. It is designed to indicate the structure of the distribution
8b395705
DK
121the line is talking about. Currently the only defined values are <em>deb</em>
122and <em>deb-src</em> which indicate a standard debian (source) archive with a
123dists directory. More about these types and the URI specification can be found
124in the sources.list manpage.
578bfd0a
AL
125
126<sect1>Hashing the URI
127<p>
dd0594df 128All permanent information acquired from any of the sources is stored in the
578bfd0a
AL
129lists directory. Thus, there must be a way to relate the filename in the
130lists directory to a line in the sourcelist. To simplify things this is
fb9ebfdb
AL
131done by quoting the URI and treating _'s as quoteable characters and
132converting / to _. The URI spec says this is done by converting a
578bfd0a 133sensitive character into %xx where xx is the hexadecimal representation
dd0594df 134from the ASCII character set. Examples:
578bfd0a
AL
135
136<example>
137http://www.debian.org/archive/dists/stable/binary-i386/Packages
b2e465d6 138/var/lib/apt/lists/www.debian.org_archive_dists_stable_binary-i386_Packages
578bfd0a
AL
139
140cdrom:Debian 1.3/debian/Packages
b2e465d6 141/var/lib/apt/info/Debian%201.3_debian_Packages
578bfd0a
AL
142</example>
143
144<p>
145The other alternative that was considered was to use a deep directory
146structure but this poses two problems, it makes it very difficult to prune
147directories back when sources are no longer used and complicates the handling
148of the partial directory. This gives a very simple way to deal with all
0a8e3465
AL
149of the situations that can arise. Also note that the same rules described in
150the <em>Archive Directory</> section regarding the partial sub dir apply
151here as well.
578bfd0a
AL
152</sect1>
153
154</sect>
155 <!-- }}} -->
86435b7d 156<!-- Extended Status {{{ -->
578bfd0a 157<!-- ===================================================================== -->
86435b7d 158<sect>Extended States File (extended_states)
578bfd0a
AL
159
160<p>
86435b7d 161The extended_states file serves the same purpose as the normal dpkg status file
0a8e3465 162(/var/lib/dpkg/status) except that it stores information unique to apt.
86435b7d
DK
163This includes currently only the autoflag but is open to store more
164unique data that come up over time. It duplicates nothing from the normal
578bfd0a 165dpkg status file. Please see other APT documentation for a discussion
86435b7d
DK
166of the exact internal behaviour of these fields. The Package and the
167Architecture field are placed directly before the new fields to indicate
168which package they apply to. The new fields are as follows:
578bfd0a
AL
169
170<taglist>
86435b7d
DK
171<tag>Auto-Installed<item>
172 The Auto flag can be 1 (Yes) or 0 (No) and controls whether the package
173 was automatical installed to satisfy a dependency or if the user requested
174 the installation
578bfd0a
AL
175</taglist>
176</sect>
177 <!-- }}} -->
178<!-- Binary Package Cache {{{ -->
179<!-- ===================================================================== -->
86435b7d 180<sect>Binary Package Cache (srcpkgcache.bin and pkgcache.bin)
578bfd0a
AL
181
182<p>
183Please see cache.sgml for a complete description of what this file is. The
184cache file is updated whenever the contents of the lists directory changes.
185If the cache is erased, corrupted or of a non-matching version it will
186be automatically rebuilt by all of the tools that need it.
187<em>srcpkgcache.bin</> contains a cache of all of the package files in the
188source list. This allows regeneration of the cache when the status files
189change to use a prebuilt version for greater speed.
190</sect>
191 <!-- }}} -->
192<!-- Downloads Directory {{{ -->
193<!-- ===================================================================== -->
194<sect>Downloads Directory (archives)
195
196<p>
197The archives directory is where all downloaded .deb archives go. When the
198file transfer is initiated the deb is placed in partial. Once the file
dd0594df 199is fully downloaded and its MD5 hash and size are verified it is moved
578bfd0a
AL
200from partial into archives/. Any files found in archives/ can be assumed
201to be verified.
202
203<p>
dd0594df 204No directory structure is transfered from the receiving site and all .deb
578bfd0a
AL
205file names conform to debian conventions. No short (msdos) filename should
206be placed in archives. If the need arises .debs should be unpacked, scanned
207and renamed to their correct internal names. This is mostly to prevent
350ed194
AL
208file name conflicts but other programs may depend on this if convenient.
209A conforming .deb is one of the form, name_version_arch.deb. Our archive
210scripts do not handle epochs, but they are necessary and should be re-inserted.
211If necessary _'s and :'s in the fields should be quoted using the % convention.
212It must be possible to extract all 3 fields by examining the file name.
578bfd0a
AL
213Downloaded .debs must be found in one of the package lists with an exact
214name + version match..
215</sect>
216 <!-- }}} -->
217<!-- The Methods Directory {{{ -->
218<!-- ===================================================================== -->
219<sect> The Methods Directory (/usr/lib/apt/methods)
220
221<p>
0a8e3465
AL
222The Methods directory is more fully described in the APT Methods interface
223document.
578bfd0a
AL
224</sect>
225 <!-- }}} -->
86435b7d 226<!-- The Configuration File {{{ -->
578bfd0a 227<!-- ===================================================================== -->
86435b7d 228<sect> The Configuration File (/etc/apt/apt.conf)
578bfd0a
AL
229
230<p>
86435b7d
DK
231The configuration file (and the associated fragments directory
232/etc/apt/apt.conf.d/) is described in the apt.conf manpage.
233</sect>
234 <!-- }}} -->
235<!-- The trusted.gpg File {{{ -->
236<!-- ===================================================================== -->
237<sect> The trusted.gpg File (/etc/apt/trusted.gpg)
578bfd0a
AL
238
239<p>
86435b7d
DK
240The trusted.gpg file (and the files in the associated fragments directory
241/etc/apt/trusted.gpg.d/) is a binary file including the keyring used
242by apt to validate that the information (e.g. the Release file) it
243downloads are really from the distributor it clams to be and is
244unmodified and is therefore the last step in the chain of trust between
245the archive and the end user. This security system is described in the
246apt-secure manpage.
578bfd0a
AL
247</sect>
248 <!-- }}} -->
249<!-- The Release File {{{ -->
250<!-- ===================================================================== -->
251<sect> The Release File
252
253<p>
86435b7d 254This file plays an important role in how APT presents the archive to the
578bfd0a
AL
255user. Its main purpose is to present a descriptive name for the source
256of each version of each package. It also is used to detect when new versions
257of debian are released. It augments the package file it is associated with
258by providing meta information about the entire archive which the Packages
259file describes.
260
261<p>
262The full name of the distribution for presentation to the user is formed
263as 'label version archive', with a possible extended name being
264'label version archive component'.
265
266<p>
267The file is formed as the package file (RFC-822) with the following tags
268defined:
269
270<taglist>
271<tag>Archive<item>
272This is the common name we give our archives, such as <em>stable</> or
273<em>unstable</>.
274
275<tag>Component<item>
dd0594df 276Refers to the sub-component of the archive, <em>main</>, <em>contrib</>
a4edf53b 277etc. Component may be omitted if there are no components for this archive.
578bfd0a
AL
278
279<tag>Version<item>
280This is a version string with the same properties as in the Packages file.
281It represents the release level of the archive.
282
283<tag>Origin<item>
284This specifies who is providing this archive. In the case of Debian the
285string will read 'Debian'. Other providers may use their own string
286
287<tag>Label<item>
288This carries the encompassing name of the distribution. For Debian proper
289this field reads 'Debian'. For derived distributions it should contain their
290proper name.
291
292<tag>Architecture<item>
293When the archive has packages for a single architecture then the Architecture
294is listed here. If a mixed set of systems are represented then this should
295contain the keyword <em>mixed</em>.
296
297<tag>NotAutomatic<item>
298A Yes/No flag indicating that the archive is extremely unstable and its
299version's should never be automatically selected. This is to be used by
300experimental.
301
302<tag>Description<item>
303Description is used to describe the release. For instance experimental would
304contain a warning that the packages have problems.
305</taglist>
306
307<p>
308The location of the Release file in the archive is very important, it must
309be located in the same location as the packages file so that it can be
310located in all situations. The following is an example for the current stable
311release, 1.3.1r6
312
313<example>
314Archive: stable
dd0594df 315Component: main
578bfd0a
AL
316Version: 1.3.1r6
317Origin: Debian
318Label: Debian
319Architecture: i386
320</example>
321
322This is an example of experimental,
323<example>
324Archive: experimental
325Version: 0
326Origin: Debian
327Label: Debian
328Architecture: mixed
329NotAutomatic: Yes
330</example>
331
332And unstable,
333<example>
334Archive: unstable
dd0594df 335Component: main
578bfd0a
AL
336Version: 2.1
337Origin: Debian
338Label: Debian
339Architecture: i386
340</example>
341
342</sect>
343 <!-- }}} -->
344
345</book>