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;
10 <title>APT Files
</title>
16 <personname>Jason Gunthorpe
</personname><email>jgg@debian.org
</email>
20 <releaseinfo>Version &apt-product-version;
</releaseinfo>
24 This document describes the complete implementation and format of the installed
25 APT directory structure. It also serves as guide to how APT views the Debian
30 <copyright><year>1998-
1999</year><holder>Jason Gunthorpe
</holder></copyright>
33 <title>License Notice
</title>
35 "APT" and this document are free software; you can redistribute them and/or
36 modify them under the terms of the GNU General Public License as published by
37 the Free Software Foundation; either version
2 of the License, or (at your
38 option) any later version.
41 For more details, on Debian systems, see the file
42 /usr/share/common-licenses/GPL for the full license.
48 <chapter id=
"ch1"><title>Introduction
</title>
50 <section id=
"s1.1"><title>General
</title>
52 This document serves two purposes. The first is to document the installed
53 directory structure and the format and purpose of each file. The second
54 purpose is to document how APT views the Debian archive and deals with multiple
58 The var directory structure is as follows:
98 As is specified in the FHS
2.1 /var/lib/apt is used for application data that
99 is not expected to be user modified. /var/cache/apt is used for regeneratable
100 data and is where the package cache and downloaded .debs go. /etc/apt is the
101 place where configuration should happen and /usr/lib/apt is the place where the
102 apt and other packages can place binaries which can be used by the acquire
109 <chapter id=
"ch2"><title>Files
</title>
111 <section id=
"s2.1"><title>Files and fragment directories in /etc/apt
</title>
113 All files in /etc/apt are used to modify specific aspects of APT. To enable
114 other packages to ship needed configuration herself all these files have a
115 fragment directory packages can place their files in instead of mangling with
116 the main files. The main files are therefore considered to be only used by the
117 user and not by a package. The documentation omits this directories most of
118 the time to be easier readable, so every time the documentation includes a
119 reference to a main file it really means the file or the fragment directories.
123 <section id=
"s2.2"><title>Distribution Source list (sources.list)
</title>
125 The distribution source list is used to locate archives of the debian
126 distribution. It is designed to support any number of active sources and to
127 support a mix of source media. The file lists one source per line, with the
128 fastest source listed first. The format of each line is:
131 <replaceable>type uri args
</replaceable>
134 The first item,
<replaceable>type
</replaceable>, indicates the format for the
135 remainder of the line. It is designed to indicate the structure of the
136 distribution the line is talking about. Currently the only defined values are
137 <emphasis>deb
</emphasis> and
<emphasis>deb-src
</emphasis> which indicate a
138 standard debian (source) archive with a dists directory. More about these
139 types and the URI specification can be found in the sources.list manpage.
142 <section id=
"s2.2.1"><title>Hashing the URI
</title>
144 All permanent information acquired from any of the sources is stored in the
145 lists directory. Thus, there must be a way to relate the filename in the lists
146 directory to a line in the sourcelist. To simplify things this is done by
147 quoting the URI and treating _'s as quoteable characters and converting /
148 to _. The URI spec says this is done by converting a sensitive character
149 into %xx where xx is the hexadecimal representation from the ASCII character
153 http://www.debian.org/archive/dists/stable/binary-i386/Packages
154 /var/lib/apt/lists/www.debian.org_archive_dists_stable_binary-i386_Packages
156 cdrom:Debian
1.3/debian/Packages
157 /var/lib/apt/info/Debian%
201.3_debian_Packages
160 The other alternative that was considered was to use a deep directory structure
161 but this poses two problems, it makes it very difficult to prune directories
162 back when sources are no longer used and complicates the handling of the
163 partial directory. This gives a very simple way to deal with all of the
164 situations that can arise. Also note that the same rules described in the
165 <emphasis>Archive Directory
</emphasis> section regarding the partial sub dir
172 <section id=
"s2.3"><title>Extended States File (extended_states)
</title>
174 The extended_states file serves the same purpose as the normal dpkg status
175 file (/var/lib/dpkg/status) except that it stores information unique to
176 apt. This includes currently only the autoflag but is open to store more
177 unique data that come up over time. It duplicates nothing from the normal
178 dpkg status file. Please see other APT documentation for a discussion of
179 the exact internal behavior of these fields. The Package and the Architecture
180 field are placed directly before the new fields to indicate which package
181 they apply to. The new fields are as follows:
185 <term>Auto-Installed
</term>
188 The Auto flag can be
1 (Yes) or
0 (No) and controls whether the package was
189 automatical installed to satisfy a dependency or if the user requested the
197 <section id=
"s2.4"><title>Binary Package Cache (srcpkgcache.bin and pkgcache.bin)
</title>
199 Please see cache.sgml for a complete description of what this file
200 is. The cache file is updated whenever the contents of the lists
201 directory changes. If the cache is erased, corrupted or of a non-matching
202 version it will be automatically rebuilt by all of the tools that need
203 it.
<emphasis>srcpkgcache.bin
</emphasis> contains a cache of all of the
204 package files in the source list. This allows regeneration of the cache
205 when the status files change to use a prebuilt version for greater speed.
209 <section id=
"s2.5"><title>Downloads Directory (archives)
</title>
211 The archives directory is where all downloaded .deb archives go. When the file
212 transfer is initiated the deb is placed in partial. Once the file is fully
213 downloaded and its MD5 hash and size are verified it is moved from partial
214 into archives/. Any files found in archives/ can be assumed to be verified.
217 No directory structure is transferred from the receiving site and all .deb file
218 names conform to debian conventions. No short (msdos) filename should be
219 placed in archives. If the need arises .debs should be unpacked, scanned and
220 renamed to their correct internal names. This is mostly to prevent file name
221 conflicts 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
223 handle 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
225 possible to extract all
3 fields by examining the file name. Downloaded .debs
226 must be found in one of the package lists with an exact name + version match..
230 <section id=
"s2.6"><title>The Methods Directory (/usr/lib/apt/methods)
</title>
232 The Methods directory is more fully described in the APT Methods interface
237 <section id=
"s2.7"><title>The Configuration File (/etc/apt/apt.conf)
</title>
239 The configuration file (and the associated fragments directory
240 /etc/apt/apt.conf.d/) is described in the apt.conf manpage.
244 <section id=
"s2.8"><title>The trusted.gpg File (/etc/apt/trusted.gpg)
</title>
246 The 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
248 validate that the information (e.g. the Release file) it downloads are really
249 from the distributor it clams to be and is unmodified and is therefore the last
250 step in the chain of trust between the archive and the end user. This security
251 system is described in the apt-secure manpage.
255 <section id=
"s2.9"><title>The Release File
</title>
257 This file plays an important role in how APT presents the archive to the
258 user. Its main purpose is to present a descriptive name for the source of
259 each version of each package. It also is used to detect when new versions
260 of debian are released. It augments the package file it is associated with
261 by providing meta information about the entire archive which the Packages
265 The 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
270 The file is formed as the package file (RFC-
822) with the following tags
278 This is the common name we give our archives, such as
279 <emphasis>stable
</emphasis> or
<emphasis>unstable
</emphasis>.
284 <term>Component
</term>
287 Refers to the sub-component of the archive,
<emphasis>main
</emphasis>,
288 <emphasis>contrib
</emphasis> etc. Component may be omitted if there are no
289 components for this archive.
297 This is a version string with the same properties as in the Packages file. It
298 represents the release level of the archive.
306 This specifies who is providing this archive. In the case of Debian the string
307 will read 'Debian'. Other providers may use their own string
315 This carries the encompassing name of the distribution. For Debian proper this
316 field reads 'Debian'. For derived distributions it should contain their proper
322 <term>Architecture
</term>
325 When the archive has packages for a single architecture then the Architecture
326 is listed here. If a mixed set of systems are represented then this should
327 contain the keyword
<emphasis>mixed
</emphasis>.
332 <term>NotAutomatic
</term>
335 A Yes/No flag indicating that the archive is extremely unstable and its
336 version's should never be automatically selected. This is to be used by
342 <term>Description
</term>
345 Description is used to describe the release. For instance experimental would
346 contain a warning that the packages have problems.
352 The location of the Release file in the archive is very important, it must be
353 located in the same location as the packages file so that it can be located in
354 all situations. The following is an example for the current stable release,
366 This is an example of experimental,
369 Archive: experimental