~oem-solutions-releng/live-build/lb-sg-2.x-add-support-for-xz-and-bzip2-compression

« back to all changes in this revision

Viewing changes to includes/etch/install/doc/FAQ/html/ch-pkg_basics.en.html

  • Committer: Daniel Baumann
  • Date: 2011-03-09 17:19:41 UTC
  • Revision ID: daniel@debian.org-20110309171941-vyn0zxupujidmbu9
Adding live-helper 1.0~a15-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2
 
 
3
 
<html>
4
 
 
5
 
<head>
6
 
 
7
 
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
8
 
 
9
 
<title>The Debian GNU/Linux FAQ - Basics of the Debian package management system</title>
10
 
 
11
 
</head>
12
 
 
13
 
<body>
14
 
 
15
 
<p><a name="ch-pkg_basics"></a></p>
16
 
<hr>
17
 
 
18
 
<p>
19
 
[ <a href="ch-ftparchives.en.html">previous</a> ]
20
 
[ <a href="index.en.html#contents">Contents</a> ]
21
 
[ <a href="ch-basic_defs.en.html">1</a> ]
22
 
[ <a href="ch-getting.en.html">2</a> ]
23
 
[ <a href="ch-compat.en.html">3</a> ]
24
 
[ <a href="ch-software.en.html">4</a> ]
25
 
[ <a href="ch-ftparchives.en.html">5</a> ]
26
 
[ 6 ]
27
 
[ <a href="ch-pkgtools.en.html">7</a> ]
28
 
[ <a href="ch-uptodate.en.html">8</a> ]
29
 
[ <a href="ch-kernel.en.html">9</a> ]
30
 
[ <a href="ch-customizing.en.html">10</a> ]
31
 
[ <a href="ch-support.en.html">11</a> ]
32
 
[ <a href="ch-contributing.en.html">12</a> ]
33
 
[ <a href="ch-redistrib.en.html">13</a> ]
34
 
[ <a href="ch-nexttime.en.html">14</a> ]
35
 
[ <a href="ch-faqinfo.en.html">15</a> ]
36
 
[ <a href="ch-pkgtools.en.html">next</a> ]
37
 
</p>
38
 
 
39
 
<hr>
40
 
 
41
 
<h1>
42
 
The Debian GNU/Linux FAQ
43
 
<br>Chapter 6 - Basics of the Debian package management system
44
 
</h1>
45
 
 
46
 
<hr>
47
 
 
48
 
<h2><a name="s-package"></a>6.1 What is a Debian package?</h2>
49
 
 
50
 
<p>
51
 
Packages generally contain all of the files necessary to implement a set of
52
 
related commands or features.  There are two types of Debian packages:
53
 
</p>
54
 
<ul>
55
 
<li>
56
 
<p>
57
 
<em>Binary packages</em>, which contain executables, configuration files,
58
 
man/info pages, copyright information, and other documentation.  These packages
59
 
are distributed in a Debian-specific archive format (see <a
60
 
href="#s-deb-format">What is the format of a Debian binary package?, Section
61
 
6.2</a>); they are usually distinguished by having a '.deb' file extension.
62
 
Binary packages can be unpacked using the Debian utility <samp>dpkg</samp>;
63
 
details are given in its manual page.
64
 
</p>
65
 
</li>
66
 
</ul>
67
 
<ul>
68
 
<li>
69
 
<p>
70
 
<em>Source packages</em>, which consist of a <samp>.dsc</samp> file describing
71
 
the source package (including the names of the following files), a
72
 
<samp>.orig.tar.gz</samp> file that contains the original unmodified source in
73
 
gzip-compressed tar format and usually a <samp>.diff.gz</samp> file that
74
 
contains the Debian-specific changes to the original source.  The utility
75
 
<samp>dpkg-source</samp> packs and unpacks Debian source archives; details are
76
 
provided in its manual page.
77
 
</p>
78
 
</li>
79
 
</ul>
80
 
 
81
 
<p>
82
 
Installation of software by the package system uses &quot;dependencies&quot;
83
 
which are carefully designed by the package maintainers.  These dependencies
84
 
are documented in the <samp>control</samp> file associated with each package.
85
 
For example, the package containing the GNU C compiler (<code>gcc</code>)
86
 
&quot;depends&quot; on the package <code>binutils</code> which includes the
87
 
linker and assembler.  If a user attempts to install <code>gcc</code> without
88
 
having first installed <code>binutils</code>, the package management system
89
 
(dpkg) will send an error message that it also needs <code>binutils</code>, and
90
 
stop installing <code>gcc</code>.  (However, this facility can be overridden by
91
 
the insistent user, see <code>dpkg(8)</code>.) See more in <a
92
 
href="#s-depends">What is meant by saying that a package <em>Depends</em>,
93
 
<em>Recommends</em>, <em>Suggests</em>, <em>Conflicts</em>, <em>Replaces</em>
94
 
or <em>Provides</em> another package?, Section 6.9</a> below.
95
 
</p>
96
 
 
97
 
<p>
98
 
Debian's packaging tools can be used to:
99
 
</p>
100
 
<ul>
101
 
<li>
102
 
<p>
103
 
manipulate and manage packages or parts of packages,
104
 
</p>
105
 
</li>
106
 
</ul>
107
 
<ul>
108
 
<li>
109
 
<p>
110
 
aid the user in the break-up of packages that must be transmitted through a
111
 
limited-size medium such as floppy disks,
112
 
</p>
113
 
</li>
114
 
</ul>
115
 
<ul>
116
 
<li>
117
 
<p>
118
 
aid developers in the construction of package archives, and
119
 
</p>
120
 
</li>
121
 
</ul>
122
 
<ul>
123
 
<li>
124
 
<p>
125
 
aid users in the installation of packages which reside on a remote FTP site.
126
 
</p>
127
 
</li>
128
 
</ul>
129
 
 
130
 
<hr>
131
 
 
132
 
<h2><a name="s-deb-format"></a>6.2 What is the format of a Debian binary package?</h2>
133
 
 
134
 
<p>
135
 
A Debian &quot;package&quot;, or a Debian archive file, contains the executable
136
 
files, libraries, and documentation associated with a particular suite of
137
 
program or set of related programs.  Normally, a Debian archive file has a
138
 
filename that ends in <samp>.deb</samp>.
139
 
</p>
140
 
 
141
 
<p>
142
 
The internals of this Debian binary packages format are described in the
143
 
<code>deb(5)</code> manual page.  This internal format is subject to change
144
 
(between major releases of Debian GNU/Linux), therefore please always use
145
 
<code>dpkg-deb(1)</code> for manipulating <samp>.deb</samp> files.
146
 
</p>
147
 
 
148
 
<hr>
149
 
 
150
 
<h2><a name="s-pkgname"></a>6.3 Why are Debian package file names so long?</h2>
151
 
 
152
 
<p>
153
 
The Debian binary package file names conform to the following convention:
154
 
&lt;foo&gt;_&lt;VersionNumber&gt;-&lt;DebianRevisionNumber&gt;.deb
155
 
</p>
156
 
 
157
 
<p>
158
 
Note that <samp>foo</samp> is supposed to be the package name.  As a check, one
159
 
can learn the package name associated with a particular Debian archive file
160
 
(.deb file) in one of these ways:
161
 
</p>
162
 
<ul>
163
 
<li>
164
 
<p>
165
 
inspect the &quot;Packages&quot; file in the directory where it was stored at a
166
 
Debian FTP archive site.  This file contains a stanza describing each package;
167
 
the first field in each stanza is the formal package name.
168
 
</p>
169
 
</li>
170
 
</ul>
171
 
<ul>
172
 
<li>
173
 
<p>
174
 
use the command <samp>dpkg --info foo_VVV-RRR.deb</samp> (where VVV and RRR are
175
 
the version and revision of the package in question, respectively).  This
176
 
displays, among other things, the package name corresponding to the archive
177
 
file being unpacked.
178
 
</p>
179
 
</li>
180
 
</ul>
181
 
 
182
 
<p>
183
 
The <samp>VVV</samp> component is the version number specified by the upstream
184
 
developer.  There are no standards in place here, so the version number may
185
 
have formats as different as &quot;19990513&quot; and &quot;1.3.8pre1&quot;.
186
 
</p>
187
 
 
188
 
<p>
189
 
The <samp>RRR</samp> component is the Debian revision number, and is specified
190
 
by the Debian developer (or an individual user if he chooses to build the
191
 
package himself).  This number corresponds to the revision level of the Debian
192
 
package, thus, a new revision level usually signifies changes in the Debian
193
 
Makefile (<samp>debian/rules</samp>), the Debian control file
194
 
(<samp>debian/control</samp>), the installation or removal scripts
195
 
(<samp>debian/p*</samp>), or in the configuration files used with the package.
196
 
</p>
197
 
 
198
 
<hr>
199
 
 
200
 
<h2><a name="s-controlfile"></a>6.4 What is a Debian control file?</h2>
201
 
 
202
 
<p>
203
 
Specifics regarding the contents of a Debian control file are provided in the
204
 
Debian Policy Manual, section 5, see <a
205
 
href="ch-support.en.html#s-debiandocs">What other documentation exists on and
206
 
for a Debian system?, Section 11.1</a>.
207
 
</p>
208
 
 
209
 
<p>
210
 
Briefly, a sample control file is shown below for the Debian package hello:
211
 
</p>
212
 
 
213
 
<pre>
214
 
     Package: hello
215
 
     Priority: optional
216
 
     Section: devel
217
 
     Installed-Size: 45
218
 
     Maintainer: Adam Heath &lt;doogie@debian.org&gt;
219
 
     Architecture: i386
220
 
     Version: 1.3-16
221
 
     Depends: libc6 (&gt;= 2.1)
222
 
     Description: The classic greeting, and a good example
223
 
      The GNU hello program produces a familiar, friendly greeting.  It
224
 
      allows nonprogrammers to use a classic computer science tool which
225
 
      would otherwise be unavailable to them.
226
 
      .
227
 
      Seriously, though: this is an example of how to do a Debian package.
228
 
      It is the Debian version of the GNU Project's `hello world' program
229
 
      (which is itself an example for the GNU Project).
230
 
</pre>
231
 
 
232
 
<p>
233
 
The Package field gives the package name.  This is the name by which the
234
 
package can be manipulated by the package tools, and usually similar to but not
235
 
necessarily the same as the first component string in the Debian archive file
236
 
name.
237
 
</p>
238
 
 
239
 
<p>
240
 
The Version field gives both the upstream developer's version number and (in
241
 
the last component) the revision level of the Debian package of this program as
242
 
explained in <a href="#s-pkgname">Why are Debian package file names so long?,
243
 
Section 6.3</a>.
244
 
</p>
245
 
 
246
 
<p>
247
 
The Architecture field specifies the chip for which this particular binary was
248
 
compiled.
249
 
</p>
250
 
 
251
 
<p>
252
 
The Depends field gives a list of packages that have to be installed in order
253
 
to install this package successfully.
254
 
</p>
255
 
 
256
 
<p>
257
 
The Installed-Size indicates how much disk space the installed package will
258
 
consume.  This is intended to be used by installation front-ends in order to
259
 
show whether there is enough disk space available to install the program.
260
 
</p>
261
 
 
262
 
<p>
263
 
The Section line gives the &quot;section&quot; where this Debian package is
264
 
stored at the Debian FTP sites.  This is the name of a subdirectory (within one
265
 
of the main directories, see <a href="ch-ftparchives.en.html#s-dirtree">What
266
 
are all those directories at the Debian FTP archives?, Section 5.1</a>) where
267
 
the package is stored.
268
 
</p>
269
 
 
270
 
<p>
271
 
The Priority indicates how important is this package for installation, so that
272
 
semi-intelligent software like dselect or console-apt can sort the package into
273
 
a category of e.g.  packages optionally installed.  See <a
274
 
href="#s-priority">What is an <em>Essential</em> <em>Required</em>,
275
 
<em>Important</em>, <em>Standard</em>, <em>Optional</em>, or <em>Extra</em>
276
 
package?, Section 6.7</a>.
277
 
</p>
278
 
 
279
 
<p>
280
 
The Maintainer field gives the e-mail address of the person who is currently
281
 
responsible for maintaining this package.
282
 
</p>
283
 
 
284
 
<p>
285
 
The Description field gives a brief summary of the package's features.
286
 
</p>
287
 
 
288
 
<p>
289
 
For more information about all possible fields a package can have, please see
290
 
the Debian Policy Manual, section 5., &quot;Control files and their
291
 
fields&quot;.
292
 
</p>
293
 
 
294
 
<hr>
295
 
 
296
 
<h2><a name="s-conffile"></a>6.5 What is a Debian conffile?</h2>
297
 
 
298
 
<p>
299
 
Conffiles is a list of configuration files (usually placed in
300
 
<samp>/etc</samp>) that the package management system will not overwrite when
301
 
the package is upgraded.  This ensures that local values for the contents of
302
 
these files will be preserved, and is a critical feature enabling the in-place
303
 
upgrade of packages on a running system.
304
 
</p>
305
 
 
306
 
<p>
307
 
To determine exactly which files are preserved during an upgrade, run:
308
 
</p>
309
 
 
310
 
<pre>
311
 
     dpkg --status package
312
 
</pre>
313
 
 
314
 
<p>
315
 
And look under &quot;Conffiles:&quot;.
316
 
</p>
317
 
 
318
 
<hr>
319
 
 
320
 
<h2><a name="s-maintscripts"></a>6.6 What is a Debian preinst, postinst, prerm, and postrm script?</h2>
321
 
 
322
 
<p>
323
 
These files are executable scripts which are automatically run before or after
324
 
a package is installed.  Along with a file named <samp>control</samp>, all of
325
 
these files are part of the &quot;control&quot; section of a Debian archive
326
 
file.
327
 
</p>
328
 
 
329
 
<p>
330
 
The individual files are:
331
 
</p>
332
 
<dl>
333
 
<dt>preinst</dt>
334
 
<dd>
335
 
<p>
336
 
This script executes before that package will be unpacked from its Debian
337
 
archive (&quot;.deb&quot;) file.  Many 'preinst' scripts stop services for
338
 
packages which are being upgraded until their installation or upgrade is
339
 
completed (following the successful execution of the 'postinst' script).
340
 
</p>
341
 
</dd>
342
 
</dl>
343
 
<dl>
344
 
<dt>postinst</dt>
345
 
<dd>
346
 
<p>
347
 
This script typically completes any required configuration of the package
348
 
<samp>foo</samp> once <samp>foo</samp> has been unpacked from its Debian
349
 
archive (&quot;.deb&quot;) file.  Often, 'postinst' scripts ask the user for
350
 
input, and/or warn the user that if he accepts default values, he should
351
 
remember to go back and re-configure that package as the situation warrants.
352
 
Many 'postinst' scripts then execute any commands necessary to start or restart
353
 
a service once a new package has been installed or upgraded.
354
 
</p>
355
 
</dd>
356
 
</dl>
357
 
<dl>
358
 
<dt>prerm</dt>
359
 
<dd>
360
 
<p>
361
 
This script typically stops any daemons which are associated with a package.
362
 
It is executed before the removal of files associated with the package.
363
 
</p>
364
 
</dd>
365
 
</dl>
366
 
<dl>
367
 
<dt>postrm</dt>
368
 
<dd>
369
 
<p>
370
 
This script typically modifies links or other files associated with
371
 
<samp>foo</samp>, and/or removes files created by the package.  (Also see <a
372
 
href="#s-virtual">What is a Virtual Package?, Section 6.8</a>.)
373
 
</p>
374
 
</dd>
375
 
</dl>
376
 
 
377
 
<p>
378
 
Currently all of the control files can be found in directory
379
 
<samp>/var/lib/dpkg/info</samp>.  The files relevant to package
380
 
<samp>foo</samp> begin with the name &quot;foo&quot; and have file extensions
381
 
of &quot;preinst&quot;, &quot;postinst&quot;, etc., as appropriate.  The file
382
 
<samp>foo.list</samp> in that directory lists all of the files that were
383
 
installed with the package <samp>foo</samp>.  (Note that the location of these
384
 
files is a dpkg internal; you should not rely on it.)
385
 
</p>
386
 
 
387
 
<hr>
388
 
 
389
 
<h2><a name="s-priority"></a>6.7 What is an <em>Essential</em> <em>Required</em>, <em>Important</em>, <em>Standard</em>, <em>Optional</em>, or <em>Extra</em> package?</h2>
390
 
 
391
 
<p>
392
 
Each Debian package is assigned a <em>priority</em> by the distribution
393
 
maintainers, as an aid to the package management system.  The priorities are:
394
 
</p>
395
 
<ul>
396
 
<li>
397
 
<p>
398
 
<strong>Required</strong>: packages that are necessary for the proper
399
 
functioning of the system.
400
 
</p>
401
 
 
402
 
<p>
403
 
This includes all tools that are necessary to repair system defects.  You must
404
 
not remove these packages or your system may become totally broken and you may
405
 
probably not even be able to use dpkg to put things back.  Systems with only
406
 
the Required packages are probably unusable, but they do have enough
407
 
functionality to allow the sysadmin to boot and install more software.
408
 
</p>
409
 
</li>
410
 
</ul>
411
 
<ul>
412
 
<li>
413
 
<p>
414
 
<strong>Important</strong> packages should be found on any Unix-like system.
415
 
</p>
416
 
 
417
 
<p>
418
 
Other packages which the system will not run well or be usable without will be
419
 
here.  This does <em>NOT</em> include Emacs or X11 or TeX or any other large
420
 
applications.  These packages only constitute the bare infrastructure.
421
 
</p>
422
 
</li>
423
 
</ul>
424
 
<ul>
425
 
<li>
426
 
<p>
427
 
<strong>Standard</strong> packages are standard on any Linux system, including
428
 
a reasonably small but not too limited character-mode system.  Tools are
429
 
included to be able to browse the web (using w3m), send e-mail (with mutt) and
430
 
download files from FTP servers.
431
 
</p>
432
 
 
433
 
<p>
434
 
This is what will install by default if users do not select anything else.  It
435
 
does not include many large applications, but it does include the Python
436
 
interpreter and some server software like OpenSSH (for remote administration),
437
 
Exim (for mail delivery, although it can be configured for local delivery
438
 
only), an identd server (pidentd) and the RPC portmapper
439
 
(<samp>portmap</samp>).  It also includes some common generic documentation
440
 
that most users will find helpful.
441
 
</p>
442
 
</li>
443
 
</ul>
444
 
<ul>
445
 
<li>
446
 
<p>
447
 
<strong>Optional</strong> packages include all those that you might reasonably
448
 
want to install if you did not know what it was, or do not have specialized
449
 
requirements.
450
 
</p>
451
 
 
452
 
<p>
453
 
This includes X11, a full TeX distribution, and lots of applications.
454
 
</p>
455
 
</li>
456
 
</ul>
457
 
<ul>
458
 
<li>
459
 
<p>
460
 
<strong>Extra</strong>: packages that either conflict with others with higher
461
 
priorities, are only likely to be useful if you already know what they are, or
462
 
have specialized requirements that make them unsuitable for
463
 
&quot;Optional&quot;.
464
 
</p>
465
 
</li>
466
 
</ul>
467
 
 
468
 
<p>
469
 
If you do a default Debian installation all the packages of priority
470
 
<strong>Standard</strong> or higher will be installed in your system.  If you
471
 
select pre-defined tasks you will get lower priority packages too.
472
 
</p>
473
 
 
474
 
<p>
475
 
Additionally, some packages are marked as <strong>Essential</strong> since they
476
 
are absolutely necessary for the proper functioning of the system.  The package
477
 
management tools will refuse to remove these.
478
 
</p>
479
 
 
480
 
<hr>
481
 
 
482
 
<h2><a name="s-virtual"></a>6.8 What is a Virtual Package?</h2>
483
 
 
484
 
<p>
485
 
A virtual package is a generic name that applies to any one of a group of
486
 
packages, all of which provide similar basic functionality.  For example, both
487
 
the <samp>tin</samp> and <samp>trn</samp> programs are news readers, and should
488
 
therefore satisfy any dependency of a program that required a news reader on a
489
 
system, in order to work or to be useful.  They are therefore both said to
490
 
provide the &quot;virtual package&quot; called <samp>news-reader</samp>.
491
 
</p>
492
 
 
493
 
<p>
494
 
Similarly, <samp>smail</samp> and <samp>sendmail</samp> both provide the
495
 
functionality of a mail transport agent.  They are therefore said to provide
496
 
the virtual package, &quot;mail transport agent&quot;.  If either one is
497
 
installed, then any program depending on the installation of a
498
 
<samp>mail-transport-agent</samp> will be satisfied by the existence of this
499
 
virtual package.
500
 
</p>
501
 
 
502
 
<p>
503
 
Debian provides a mechanism so that, if more than one package which provide the
504
 
same virtual package is installed on a system, then system administrators can
505
 
set one as the preferred package.  The relevant command is
506
 
<samp>update-alternatives</samp>, and is described further in <a
507
 
href="ch-customizing.en.html#s-diverse">Some users like mawk, others like gawk;
508
 
some like vim, others like elvis; some like trn, others like tin; how does
509
 
Debian support diversity?, Section 10.10</a>.
510
 
</p>
511
 
 
512
 
<hr>
513
 
 
514
 
<h2><a name="s-depends"></a>6.9 What is meant by saying that a package <em>Depends</em>, <em>Recommends</em>, <em>Suggests</em>, <em>Conflicts</em>, <em>Replaces</em> or <em>Provides</em> another package?</h2>
515
 
 
516
 
<p>
517
 
The Debian package system has a range of package &quot;dependencies&quot; which
518
 
are designed to indicate (in a single flag) the level at which Program A can
519
 
operate independently of the existence of Program B on a given system:
520
 
</p>
521
 
<ul>
522
 
<li>
523
 
<p>
524
 
Package A <em>depends</em> on Package B if B absolutely must be installed in
525
 
order to run A.  In some cases, A depends not only on B, but on a version of B.
526
 
In this case, the version dependency is usually a lower limit, in the sense
527
 
that A depends on any version of B more recent than some specified version.
528
 
</p>
529
 
</li>
530
 
</ul>
531
 
<ul>
532
 
<li>
533
 
<p>
534
 
Package A <em>recommends</em> Package B, if the package maintainer judges that
535
 
most users would not want A without also having the functionality provided by
536
 
B.
537
 
</p>
538
 
</li>
539
 
</ul>
540
 
<ul>
541
 
<li>
542
 
<p>
543
 
Package A <em>suggests</em> Package B if B contains files that are related to
544
 
(and usually enhance) the functionality of A.
545
 
</p>
546
 
</li>
547
 
</ul>
548
 
<ul>
549
 
<li>
550
 
<p>
551
 
Package A <em>conflicts</em> with Package B when A will not operate if B is
552
 
installed on the system.  Most often, conflicts are cases where A contains
553
 
files which are an improvement over those in B.  &quot;Conflicts&quot; are
554
 
often combined with &quot;replaces&quot;.
555
 
</p>
556
 
</li>
557
 
</ul>
558
 
<ul>
559
 
<li>
560
 
<p>
561
 
Package A <em>replaces</em> Package B when files installed by B are removed and
562
 
(in some cases) over-written by files in A.
563
 
</p>
564
 
</li>
565
 
</ul>
566
 
<ul>
567
 
<li>
568
 
<p>
569
 
Package A <em>provides</em> Package B when all of the files and functionality
570
 
of B are incorporated into A.  This mechanism provides a way for users with
571
 
constrained disk space to get only that part of package A which they really
572
 
need.
573
 
</p>
574
 
</li>
575
 
</ul>
576
 
 
577
 
<p>
578
 
More detailed information on the use of each these terms can be found in the
579
 
Policy manual.
580
 
</p>
581
 
 
582
 
<hr>
583
 
 
584
 
<h2><a name="s-pre-depends"></a>6.10 What is meant by Pre-Depends?</h2>
585
 
 
586
 
<p>
587
 
&quot;Pre-Depends&quot; is a special dependency.  In the case of most packages,
588
 
<samp>dpkg</samp> will unpack its archive file (i.e., its <samp>.deb</samp>
589
 
file) independently of whether or not the files on which it depends exist on
590
 
the system.  Simplistically, unpacking means that <samp>dpkg</samp> will
591
 
extract the files from the archive file that were meant to be installed on your
592
 
file system, and put them in place.  If those packages <em>depend</em> on the
593
 
existence of some other packages on your system, <samp>dpkg</samp> will refuse
594
 
to complete the installation (by executing its &quot;configure&quot; action)
595
 
until the other packages are installed.
596
 
</p>
597
 
 
598
 
<p>
599
 
However, for some packages, <samp>dpkg</samp> will refuse even to unpack them
600
 
until certain dependencies are resolved.  Such packages are said to
601
 
&quot;Pre-depend&quot; on the presence of some other packages.  The Debian
602
 
project provided this mechanism to support the safe upgrading of systems from
603
 
<samp>a.out</samp> format to <samp>ELF</samp> format, where the <em>order</em>
604
 
in which packages were unpacked was critical.  There are other large upgrade
605
 
situations where this method is useful, e.g.  the packages with the required
606
 
priority and their LibC dependency.
607
 
</p>
608
 
 
609
 
<p>
610
 
As before, more detailed information about this can be found in the Policy
611
 
manual.
612
 
</p>
613
 
 
614
 
<hr>
615
 
 
616
 
<h2><a name="s-pkgstatus"></a>6.11 What is meant by <em>unknown</em>, <em>install</em>, <em>remove</em> <em>purge</em> and <em>hold</em> in the package status?</h2>
617
 
 
618
 
<p>
619
 
These &quot;want&quot; flags tell what the user wanted to do with a package (as
620
 
indicated either by the user's actions in the &quot;Select&quot; section of
621
 
<samp>dselect</samp>, or by the user's direct invocations of
622
 
<samp>dpkg</samp>).
623
 
</p>
624
 
 
625
 
<p>
626
 
Their meanings are:
627
 
</p>
628
 
<ul>
629
 
<li>
630
 
<p>
631
 
unknown - the user has never indicated whether he wants the package
632
 
</p>
633
 
</li>
634
 
</ul>
635
 
<ul>
636
 
<li>
637
 
<p>
638
 
install - the user wants the package installed or upgraded
639
 
</p>
640
 
</li>
641
 
</ul>
642
 
<ul>
643
 
<li>
644
 
<p>
645
 
remove - the user wants the package removed, but does not want to remove any
646
 
existing configuration files.
647
 
</p>
648
 
</li>
649
 
</ul>
650
 
<ul>
651
 
<li>
652
 
<p>
653
 
purge - the user wants the package to be removed completely, including its
654
 
configuration files.
655
 
</p>
656
 
</li>
657
 
</ul>
658
 
<ul>
659
 
<li>
660
 
<p>
661
 
hold - the user wants this package not to be processed, i.e., he wants to keep
662
 
the current version with the current status whatever that is.
663
 
</p>
664
 
</li>
665
 
</ul>
666
 
 
667
 
<hr>
668
 
 
669
 
<h2><a name="s-puttingonhold"></a>6.12 How do I put a package on hold?</h2>
670
 
 
671
 
<p>
672
 
There are three ways of holding back packages, with dpkg, aptitude or with
673
 
dselect.
674
 
</p>
675
 
 
676
 
<p>
677
 
With dpkg, you just have to export the list of package selections, with:
678
 
</p>
679
 
 
680
 
<pre>
681
 
     dpkg --get-selections \* &gt; selections.txt
682
 
</pre>
683
 
 
684
 
<p>
685
 
Then edit the resulting file <code>selections.txt</code>, change the line
686
 
containing the package you wish to hold, e.g.  <code>libc6</code>, from this:
687
 
</p>
688
 
 
689
 
<pre>
690
 
     libc6                                           install
691
 
</pre>
692
 
 
693
 
<p>
694
 
to this:
695
 
</p>
696
 
 
697
 
<pre>
698
 
     libc6                                           hold
699
 
</pre>
700
 
 
701
 
<p>
702
 
Save the file, and reload it into dpkg database with:
703
 
</p>
704
 
 
705
 
<pre>
706
 
     dpkg --set-selections &lt; selections.txt
707
 
</pre>
708
 
 
709
 
<p>
710
 
With aptitude, you can hold a package using
711
 
</p>
712
 
 
713
 
<pre>
714
 
     aptitude hold package_name
715
 
</pre>
716
 
 
717
 
<p>
718
 
and remove the hold with
719
 
</p>
720
 
 
721
 
<pre>
722
 
     aptitude unhold package_name
723
 
</pre>
724
 
 
725
 
<p>
726
 
With dselect, you just have to enter the [S]elect screen, find the package you
727
 
wish to hold in its present state, and press the `=' key (or `H').  The changes
728
 
will go live immediately after you exit the [S]elect screen.
729
 
</p>
730
 
 
731
 
<hr>
732
 
 
733
 
<h2><a name="s-sourcepkgs"></a>6.13 How do I install a source package?</h2>
734
 
 
735
 
<p>
736
 
Debian source packages can't actually be &quot;installed&quot;, they are just
737
 
unpacked in whatever directory you want to build the binary packages they
738
 
produce.
739
 
</p>
740
 
 
741
 
<p>
742
 
Source packages are distributed on most of the same mirrors where you can
743
 
obtain the binary packages.  If you set up your APT's
744
 
<code>sources.list(5)</code> to include the appropriate &quot;deb-src&quot;
745
 
lines, you'll be able to easily download any source packages by running
746
 
</p>
747
 
 
748
 
<pre>
749
 
     apt-get source foo
750
 
</pre>
751
 
 
752
 
<p>
753
 
To help you in actually building the source package, Debian source package
754
 
provide the so-called build-dependencies mechanism.  This means that the source
755
 
package maintainer keeps a list of other packages that are required to build
756
 
their package.  To see how this is useful, run
757
 
</p>
758
 
 
759
 
<pre>
760
 
     apt-get build-dep foo
761
 
</pre>
762
 
 
763
 
<p>
764
 
before building the source.
765
 
</p>
766
 
 
767
 
<hr>
768
 
 
769
 
<h2><a name="s-sourcebuild"></a>6.14 How do I build binary packages from a source package?</h2>
770
 
 
771
 
<p>
772
 
You will need all of foo_*.dsc, foo_*.tar.gz and foo_*.diff.gz to compile the
773
 
source (note: there is no .diff.gz for some packages that are native to
774
 
Debian).
775
 
</p>
776
 
 
777
 
<p>
778
 
Once you have them (<a href="#s-sourcepkgs">How do I install a source package?,
779
 
Section 6.13</a>), if you have the <code>dpkg-dev</code> package installed, the
780
 
following command:
781
 
</p>
782
 
 
783
 
<pre>
784
 
     dpkg-source -x foo_version-revision.dsc
785
 
</pre>
786
 
 
787
 
<p>
788
 
will extract the package into a directory called <samp>foo-version</samp>.
789
 
</p>
790
 
 
791
 
<p>
792
 
If you want just to compile the package, you may cd into
793
 
<samp>foo-version</samp> directory and issue the command
794
 
</p>
795
 
 
796
 
<pre>
797
 
     dpkg-buildpackage -rfakeroot -b
798
 
</pre>
799
 
 
800
 
<p>
801
 
to build the package (note that this also requires the <code>fakeroot</code>
802
 
package), and then
803
 
</p>
804
 
 
805
 
<pre>
806
 
     dpkg -i ../foo_version-revision_arch.deb
807
 
</pre>
808
 
 
809
 
<p>
810
 
to install the newly-built package(s).
811
 
</p>
812
 
 
813
 
<hr>
814
 
 
815
 
<h2><a name="s-creatingdebs"></a>6.15 How do I create Debian packages myself?</h2>
816
 
 
817
 
<p>
818
 
For more detailed description on this, read the New Maintainers' Guide,
819
 
available in the <code>maint-guide</code> package, or at <code><a
820
 
href="http://www.debian.org/doc/devel-manuals#maint-guide">http://www.debian.org/doc/devel-manuals#maint-guide</a></code>.
821
 
</p>
822
 
 
823
 
<hr>
824
 
 
825
 
<p>
826
 
[ <a href="ch-ftparchives.en.html">previous</a> ]
827
 
[ <a href="index.en.html#contents">Contents</a> ]
828
 
[ <a href="ch-basic_defs.en.html">1</a> ]
829
 
[ <a href="ch-getting.en.html">2</a> ]
830
 
[ <a href="ch-compat.en.html">3</a> ]
831
 
[ <a href="ch-software.en.html">4</a> ]
832
 
[ <a href="ch-ftparchives.en.html">5</a> ]
833
 
[ 6 ]
834
 
[ <a href="ch-pkgtools.en.html">7</a> ]
835
 
[ <a href="ch-uptodate.en.html">8</a> ]
836
 
[ <a href="ch-kernel.en.html">9</a> ]
837
 
[ <a href="ch-customizing.en.html">10</a> ]
838
 
[ <a href="ch-support.en.html">11</a> ]
839
 
[ <a href="ch-contributing.en.html">12</a> ]
840
 
[ <a href="ch-redistrib.en.html">13</a> ]
841
 
[ <a href="ch-nexttime.en.html">14</a> ]
842
 
[ <a href="ch-faqinfo.en.html">15</a> ]
843
 
[ <a href="ch-pkgtools.en.html">next</a> ]
844
 
</p>
845
 
 
846
 
<hr>
847
 
 
848
 
<p>
849
 
The Debian GNU/Linux FAQ
850
 
</p>
851
 
 
852
 
<address>
853
 
version 3.1.5, 17 January 2007<br>
854
 
<br>
855
 
Authors are listed at <a href="ch-faqinfo.en.html#s-authors">Debian FAQ Authors</a><br>
856
 
<br>
857
 
</address>
858
 
<hr>
859
 
 
860
 
</body>
861
 
 
862
 
</html>
863