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