doc: Convert from DebianDoc SGML to DocBook XML
[ntk/apt.git] / doc / files.dbk
CommitLineData
271733ee
GJ
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- -*- DocBook -*- -->
3<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
4 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
5<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent"> %aptverbatiment;
6]>
7
8<book lang="en">
9
10<title>APT Files</title>
11
12<bookinfo>
13
14<authorgroup>
15 <author>
16 <personname>Jason Gunthorpe</personname><email>jgg@debian.org</email>
17 </author>
18</authorgroup>
19
20<releaseinfo>Version &apt-product-version;</releaseinfo>
21
22<abstract>
23<para>
24This document describes the complete implementation and format of the installed
25APT directory structure. It also serves as guide to how APT views the Debian
26archive.
27</para>
28</abstract>
29
30<copyright><year>1998-1999</year><holder>Jason Gunthorpe</holder></copyright>
31
32<legalnotice>
33<title>License Notice</title>
34<para>
35"APT" and this document are free software; you can redistribute them and/or
36modify them under the terms of the GNU General Public License as published by
37the Free Software Foundation; either version 2 of the License, or (at your
38option) any later version.
39</para>
40<para>
41For more details, on Debian systems, see the file
42/usr/share/common-licenses/GPL for the full license.
43</para>
44</legalnotice>
45
46</bookinfo>
47
48<chapter id="ch1"><title>Introduction</title>
49
50<section id="s1.1"><title>General</title>
51<para>
52This document serves two purposes. The first is to document the installed
53directory structure and the format and purpose of each file. The second
54purpose is to document how APT views the Debian archive and deals with multiple
55package files.
56</para>
57<para>
58The var directory structure is as follows:
59</para>
60<screen>
61 /var/lib/apt/
62 lists/
63 partial/
64 periodic/
65 extended_states
66 cdroms.list
67 /var/cache/apt/
68 archives/
69 partial/
70 pkgcache.bin
71 srcpkgcache.bin
72 /etc/apt/
73 sources.list.d/
74 apt.conf.d/
75 preferences.d/
76 trusted.gpg.d/
77 sources.list
78 apt.conf
79 apt_preferences
80 trusted.gpg
81 /usr/lib/apt/
82 methods/
83 bzip2
84 cdrom
85 copy
86 file
87 ftp
88 gpgv
89 gzip
90 http
91 https
92 lzma
93 rred
94 rsh
95 ssh
96</screen>
97<para>
98As is specified in the FHS 2.1 /var/lib/apt is used for application data that
99is not expected to be user modified. /var/cache/apt is used for regeneratable
100data and is where the package cache and downloaded .debs go. /etc/apt is the
101place where configuration should happen and /usr/lib/apt is the place where the
102apt and other packages can place binaries which can be used by the acquire
103system of APT.
104</para>
105</section>
106
107</chapter>
108
109<chapter id="ch2"><title>Files</title>
110
111<section id="s2.1"><title>Files and fragment directories in /etc/apt</title>
112<para>
113All files in /etc/apt are used to modify specific aspects of APT. To enable
114other packages to ship needed configuration herself all these files have a
115fragment directory packages can place their files in instead of mangling with
116the main files. The main files are therefore considered to be only used by the
117user and not by a package. The documentation omits this directories most of
118the time to be easier readable, so every time the documentation includes a
119reference to a main file it really means the file or the fragment directories.
120</para>
121</section>
122
123<section id="s2.2"><title>Distribution Source list (sources.list)</title>
124<para>
125The distribution source list is used to locate archives of the debian
126distribution. It is designed to support any number of active sources and to
127support a mix of source media. The file lists one source per line, with the
128fastest source listed first. The format of each line is:
129</para>
130<para>
131<replaceable>type uri args</replaceable>
132</para>
133<para>
134The first item, <replaceable>type</replaceable>, indicates the format for the
135remainder of the line. It is designed to indicate the structure of the
136distribution the line is talking about. Currently the only defined values are
137<emphasis>deb</emphasis> and <emphasis>deb-src</emphasis> which indicate a
138standard debian (source) archive with a dists directory. More about these
139types and the URI specification can be found in the sources.list manpage.
140</para>
141
142<section id="s2.2.1"><title>Hashing the URI</title>
143<para>
144All permanent information acquired from any of the sources is stored in the
145lists directory. Thus, there must be a way to relate the filename in the lists
146directory to a line in the sourcelist. To simplify things this is done by
147quoting the URI and treating _'s as quoteable characters and converting /
148to _. The URI spec says this is done by converting a sensitive character
149into %xx where xx is the hexadecimal representation from the ASCII character
150set. Examples:
151</para>
152<screen>
153http://www.debian.org/archive/dists/stable/binary-i386/Packages
154/var/lib/apt/lists/www.debian.org_archive_dists_stable_binary-i386_Packages
155
156cdrom:Debian 1.3/debian/Packages
157/var/lib/apt/info/Debian%201.3_debian_Packages
158</screen>
159<para>
160The other alternative that was considered was to use a deep directory structure
161but this poses two problems, it makes it very difficult to prune directories
162back when sources are no longer used and complicates the handling of the
163partial directory. This gives a very simple way to deal with all of the
164situations that can arise. Also note that the same rules described in the
165<emphasis>Archive Directory</emphasis> section regarding the partial sub dir
166apply here as well.
167</para>
168</section>
169
170</section>
171
172<section id="s2.3"><title>Extended States File (extended_states)</title>
173<para>
174The extended_states file serves the same purpose as the normal dpkg status
175file (/var/lib/dpkg/status) except that it stores information unique to
176apt. This includes currently only the autoflag but is open to store more
177unique data that come up over time. It duplicates nothing from the normal
178dpkg status file. Please see other APT documentation for a discussion of
179the exact internal behavior of these fields. The Package and the Architecture
180field are placed directly before the new fields to indicate which package
181they apply to. The new fields are as follows:
182</para>
183<variablelist>
184<varlistentry>
185<term>Auto-Installed</term>
186<listitem>
187<para>
188The Auto flag can be 1 (Yes) or 0 (No) and controls whether the package was
189automatical installed to satisfy a dependency or if the user requested the
190installation
191</para>
192</listitem>
193</varlistentry>
194</variablelist>
195</section>
196
197<section id="s2.4"><title>Binary Package Cache (srcpkgcache.bin and pkgcache.bin)</title>
198<para>
199Please see cache.sgml for a complete description of what this file
200is. The cache file is updated whenever the contents of the lists
201directory changes. If the cache is erased, corrupted or of a non-matching
202version it will be automatically rebuilt by all of the tools that need
203it. <emphasis>srcpkgcache.bin</emphasis> contains a cache of all of the
204package files in the source list. This allows regeneration of the cache
205when the status files change to use a prebuilt version for greater speed.
206</para>
207</section>
208
209<section id="s2.5"><title>Downloads Directory (archives)</title>
210<para>
211The archives directory is where all downloaded .deb archives go. When the file
212transfer is initiated the deb is placed in partial. Once the file is fully
213downloaded and its MD5 hash and size are verified it is moved from partial
214into archives/. Any files found in archives/ can be assumed to be verified.
215</para>
216<para>
217No directory structure is transferred from the receiving site and all .deb file
218names conform to debian conventions. No short (msdos) filename should be
219placed in archives. If the need arises .debs should be unpacked, scanned and
220renamed to their correct internal names. This is mostly to prevent file name
221conflicts but other programs may depend on this if convenient. A conforming
222.deb is one of the form, name_version_arch.deb. Our archive scripts do not
223handle epochs, but they are necessary and should be re-inserted. If necessary
224_'s and :'s in the fields should be quoted using the % convention. It must be
225possible to extract all 3 fields by examining the file name. Downloaded .debs
226must be found in one of the package lists with an exact name + version match..
227</para>
228</section>
229
230<section id="s2.6"><title>The Methods Directory (/usr/lib/apt/methods)</title>
231<para>
232The Methods directory is more fully described in the APT Methods interface
233document.
234</para>
235</section>
236
237<section id="s2.7"><title>The Configuration File (/etc/apt/apt.conf)</title>
238<para>
239The configuration file (and the associated fragments directory
240/etc/apt/apt.conf.d/) is described in the apt.conf manpage.
241</para>
242</section>
243
244<section id="s2.8"><title>The trusted.gpg File (/etc/apt/trusted.gpg)</title>
245<para>
246The trusted.gpg file (and the files in the associated fragments directory
247/etc/apt/trusted.gpg.d/) is a binary file including the keyring used by apt to
248validate that the information (e.g. the Release file) it downloads are really
249from the distributor it clams to be and is unmodified and is therefore the last
250step in the chain of trust between the archive and the end user. This security
251system is described in the apt-secure manpage.
252</para>
253</section>
254
255<section id="s2.9"><title>The Release File</title>
256<para>
257This file plays an important role in how APT presents the archive to the
258user. Its main purpose is to present a descriptive name for the source of
259each version of each package. It also is used to detect when new versions
260of debian are released. It augments the package file it is associated with
261by providing meta information about the entire archive which the Packages
262file describes.
263</para>
264<para>
265The full name of the distribution for presentation to the user is formed as
266'label version archive', with a possible extended name being 'label version
267archive component'.
268</para>
269<para>
270The file is formed as the package file (RFC-822) with the following tags
271defined:
272</para>
273<variablelist>
274<varlistentry>
275<term>Archive</term>
276<listitem>
277<para>
278This is the common name we give our archives, such as
279<emphasis>stable</emphasis> or <emphasis>unstable</emphasis>.
280</para>
281</listitem>
282</varlistentry>
283<varlistentry>
284<term>Component</term>
285<listitem>
286<para>
287Refers to the sub-component of the archive, <emphasis>main</emphasis>,
288<emphasis>contrib</emphasis> etc. Component may be omitted if there are no
289components for this archive.
290</para>
291</listitem>
292</varlistentry>
293<varlistentry>
294<term>Version</term>
295<listitem>
296<para>
297This is a version string with the same properties as in the Packages file. It
298represents the release level of the archive.
299</para>
300</listitem>
301</varlistentry>
302<varlistentry>
303<term>Origin</term>
304<listitem>
305<para>
306This specifies who is providing this archive. In the case of Debian the string
307will read 'Debian'. Other providers may use their own string
308</para>
309</listitem>
310</varlistentry>
311<varlistentry>
312<term>Label</term>
313<listitem>
314<para>
315This carries the encompassing name of the distribution. For Debian proper this
316field reads 'Debian'. For derived distributions it should contain their proper
317name.
318</para>
319</listitem>
320</varlistentry>
321<varlistentry>
322<term>Architecture</term>
323<listitem>
324<para>
325When the archive has packages for a single architecture then the Architecture
326is listed here. If a mixed set of systems are represented then this should
327contain the keyword <emphasis>mixed</emphasis>.
328</para>
329</listitem>
330</varlistentry>
331<varlistentry>
332<term>NotAutomatic</term>
333<listitem>
334<para>
335A Yes/No flag indicating that the archive is extremely unstable and its
336version's should never be automatically selected. This is to be used by
337experimental.
338</para>
339</listitem>
340</varlistentry>
341<varlistentry>
342<term>Description</term>
343<listitem>
344<para>
345Description is used to describe the release. For instance experimental would
346contain a warning that the packages have problems.
347</para>
348</listitem>
349</varlistentry>
350</variablelist>
351<para>
352The location of the Release file in the archive is very important, it must be
353located in the same location as the packages file so that it can be located in
354all situations. The following is an example for the current stable release,
3551.3.1r6
356</para>
357<screen>
358Archive: stable
359Component: main
360Version: 1.3.1r6
361Origin: Debian
362Label: Debian
363Architecture: i386
364</screen>
365<para>
366This is an example of experimental,
367</para>
368<screen>
369Archive: experimental
370Version: 0
371Origin: Debian
372Label: Debian
373Architecture: mixed
374NotAutomatic: Yes
375</screen>
376<para>
377And unstable,
378</para>
379<screen>
380Archive: unstable
381Component: main
382Version: 2.1
383Origin: Debian
384Label: Debian
385Architecture: i386
386</screen>
387</section>
388
389</chapter>
390
391
392</book>