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