1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
|
# dpkg manual page - dpkg(1)
#
# Copyright © 1996 Juho Vuori <javuori@cc.helsinki.fi>
# Copyright © 1999 Jim Van Zandt <jrv@vanzandt.mv.com>
# Copyright © 1999-2003 Wichert Akkerman <wakkerma@debian.org>
# Copyright © 2000-2003 Adam Heath <doogie@debian.org>
# Copyright © 2002 Josip Rodin
# Copyright © 2004-2005 Scott James Remnant <keybuk@debian.org>
# Copyright © 2006-2016 Guillem Jover <guillem@debian.org>
# Copyright © 2007-2008 Ian Jackson <ijackson@chiark.greenend.org.uk>
# Copyright © 2008-2011 Raphaël Hertzog <hertzog@debian.org>
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
=encoding utf8
=head1 NAME
dpkg - package manager for Debian
=head1 SYNOPSIS
B<dpkg>
[I<option>...] I<action>
=head1 WARNING
This manual is intended for users wishing to understand B<dpkg>'s
command line options and package states in more detail than that
provided by B<dpkg --help>.
It should I<not> be used by package maintainers wishing to
understand how B<dpkg> will install their packages.
The
descriptions of what B<dpkg> does when installing and removing
packages are particularly inadequate.
=head1 DESCRIPTION
B<dpkg> is a medium-level tool to install, build, remove and manage
Debian packages.
The primary and more user-friendly front-end for B<dpkg>
as a CLI (command-line interface) is L<apt(8)> and
as a TUI (terminal user interface) is L<aptitude(8)>.
B<dpkg> itself is
controlled entirely via command line parameters, which consist of exactly
one action and zero or more options.
The action-parameter tells B<dpkg>
what to do and options control the behavior of the action in some way.
B<dpkg> can also be used as a front-end to L<dpkg-deb(1)> and
L<dpkg-query(1)>.
The list of supported actions can be found later on in the B<ACTIONS> section.
If any such action is encountered B<dpkg>
just runs B<dpkg-deb> or B<dpkg-query> with the parameters given
to it, but no specific options are currently passed to them, to use
any such option the back-ends need to be called directly.
=head1 INFORMATION ABOUT PACKAGES
B<dpkg> maintains some usable information about available
packages.
The information is divided in three classes: B<states>,
B<selection states> and B<flags>.
These values are intended to
be changed mainly with B<dselect>.
=head2 Package states
=over
=item B<not-installed>
The package is not installed on your system.
=item B<config-files>
Only the configuration files or the B<postrm> script and the data it needs
to remove of the package exist on the system.
=item B<half-installed>
The installation of the package has been started, but not completed for
some reason.
=item B<unpacked>
The package is unpacked, but not configured.
=item B<half-configured>
The package is unpacked and configuration has been started, but not yet
completed for some reason.
=item B<triggers-awaited>
The package awaits trigger processing by another package.
=item B<triggers-pending>
The package has been triggered.
=item B<installed>
The package is correctly unpacked and configured.
=back
=head2 Package selection states
=over
=item B<install>
The package is selected for installation.
=item B<hold>
A package marked to be on B<hold> is kept on the same version, that is,
no automatic new installs, upgrades or removals will be performed on them,
unless these actions are requested explicitly, or are permitted to be done
automatically with the B<--force-hold> option.
=item B<deinstall>
The package is selected for deinstallation (i.e. we want to remove all
files, except configuration files).
=item B<purge>
The package is selected to be purged (i.e. we want to remove everything
from system directories, even configuration files).
=item B<unknown>
The package selection is unknown.
A package that is also in a B<not-installed> state, and with an
B<ok> flag will be forgotten in the next database store.
=back
=head2 Package flags
=over
=item B<ok>
A package marked B<ok> is in a known state, but might need further
processing.
=item B<reinstreq>
A package marked B<reinstreq> is broken and requires
reinstallation.
These packages cannot be removed, unless forced with
option B<--force-remove-reinstreq>.
=back
=head1 ACTIONS
=over
=item B<-i>, B<--install> I<package-file>...
Install the package.
If B<--recursive> or B<-R> option is
specified, I<package-file> must refer to a directory instead.
Installation consists of the following steps:
=over 4
=item B<1.>
Extract the control files of the new package.
=item B<2.>
If another version of the same package was installed before
the new installation, execute I<prerm> script of the old package.
=item B<3.>
Run I<preinst> script, if provided by the package.
=item B<4.>
Unpack the new files, and at the same time back up the old
files, so that if something goes wrong, they can be restored.
=item B<5.>
If another version of the same package was installed before
the new installation, execute the I<postrm> script of the old
package.
Note that this script is executed after the I<preinst>
script of the new package, because new files are written at the same
time old files are removed.
=item B<6.>
Configure the package.
See B<--configure> for detailed
information about how this is done.
=back
=item B<--unpack> I<package-file>...
Unpack the package, but don't configure it.
If B<--recursive> or
B<-R> option is specified, I<package-file> must refer to a
directory instead.
Will process triggers for B<Pre-Depends> unless B<--no-triggers> has
been specified.
=item B<--configure> I<package>...|B<-a>|B<--pending>
Configure a package which has been unpacked but not yet configured.
If B<-a> or B<--pending> is given instead of I<package>,
all unpacked but unconfigured packages are configured.
To reconfigure a package which has already been configured, try the
L<dpkg-reconfigure(8)> command instead (which is part of the B<debconf>
project).
Configuring consists of the following steps:
=over 4
=item B<1.>
Unpack the conffiles, and at the same time back up
the old conffiles, so that they can be restored if
something goes wrong.
=item B<2.>
Run I<postinst> script, if provided by the package.
=back
Will process triggers unless B<--no-triggers> has been specified.
=item B<--triggers-only> I<package>...|B<-a>|B<--pending>
Processes only triggers (since dpkg 1.14.17).
All pending triggers will be processed.
If package
names are supplied only those packages' triggers will be processed, exactly
once each where necessary.
Use of this option may leave packages in the improper B<triggers-awaited>
and B<triggers-pending> states.
This
can be fixed later by running: B<dpkg --configure --pending>.
=item B<-r>, B<--remove> I<package>...|B<-a>|B<--pending>
Remove an installed package.
This removes everything except conffiles and other data cleaned up by
the I<postrm> script,
which may avoid having to reconfigure the package if it is reinstalled
later (conffiles are configuration files that are listed in the
I<DEBIAN/conffiles> control file).
If there is no I<DEBIAN/conffiles> control file nor I<DEBIAN/postrm>
script, this command is equivalent to calling B<--purge>.
If B<-a> or B<--pending> is given instead of a package name,
then all packages unpacked, but marked to be removed in file
I<%ADMINDIR%/status>, are removed.
Removing of a package consists of the following steps:
=over 4
=item B<1.>
Run I<prerm> script.
=item B<2.>
Remove the installed files.
=item B<3.>
Run I<postrm> script.
=back
Will process triggers unless B<--no-triggers> has been specified.
=item B<-P>, B<--purge> I<package>...|B<-a>|B<--pending>
Purge an installed or already removed package.
This removes everything,
including conffiles, and anything else cleaned up from I<postrm>.
If B<-a> or B<--pending> is given instead of a package name,
then all packages unpacked or removed, but marked to be purged in file
I<%ADMINDIR%/status>, are purged.
B<Note>: Some configuration files might be unknown to B<dpkg> because they
are created and handled separately through the configuration scripts.
In
that case, B<dpkg> won't remove them by itself, but the package's
I<postrm> script (which is called by B<dpkg>), has to take care of
their removal during purge.
Of course, this only applies to files in
system directories, not configuration files written to individual users'
home directories.
Purging of a package consists of the following steps:
=over 4
=item B<1.>
Remove the package, if not already removed.
See B<--remove>
for detailed information about how this is done.
=item B<2.>
Run I<postrm> script.
=back
Will process triggers unless B<--no-triggers> has been specified.
=item B<-V>, B<--verify> [I<package-name>...]
Verifies the integrity of I<package-name> or all packages if omitted,
by comparing information from the files installed by a package with the
files metadata information stored in the B<dpkg> database
(since dpkg 1.17.2).
The origin
of the files metadata information in the database is the binary packages
themselves.
That metadata gets collected at package unpack time during
the installation process.
Currently the only functional check performed is an md5sum verification
of the file contents against the stored value in the files database.
It will only get checked
if the database contains the file md5sum.
To check for any missing
metadata in the database, the B<--audit> command can be used.
This is only an integrity check and should not be considered as any
kind of security verification.
The output format is selectable with the B<--verify-format>
option, which by default uses the B<rpm> format, but that might
change in the future, and as such, programs parsing this command
output should be explicit about the format they expect.
=item B<-C>, B<--audit> [I<package-name>...]
Performs database sanity and consistency checks for I<package-name>
or all packages if omitted (per package checks since dpkg 1.17.10).
For example, searches for packages that have been installed only partially
on your system or that have missing, wrong or obsolete control data or
files.
B<dpkg> will suggest what to do with them to get them fixed.
=item B<--update-avail> [I<Packages-file>]
=item B<--merge-avail> [I<Packages-file>]
Update B<dpkg>'s and B<dselect>'s idea of which packages are
available.
With action B<--merge-avail>,
old information is combined with information from I<Packages-file>.
With action
B<--update-avail>, old information is replaced with the information
in the I<Packages-file>.
The I<Packages-file> distributed with Debian is simply named «I<Packages>».
If the I<Packages-file>
argument is missing or named «B<->» then it will be read from
standard input (since dpkg 1.17.7).
B<dpkg> keeps its record of
available packages in I<%ADMINDIR%/available>.
A simpler one-shot command to retrieve and update the I<available>
file is B<dselect update>.
Note that this file is mostly useless
if you don't use B<dselect> but an APT-based frontend: APT has its
own system to keep track of available packages.
=item B<-A>, B<--record-avail> I<package-file>...
Update B<dpkg> and B<dselect>'s idea of which packages are
available with information from the package I<package-file>.
If
B<--recursive> or B<-R> option is specified, I<package-file>
must refer to a directory instead.
=item B<--forget-old-unavail>
Now B<obsolete> and a no-op as B<dpkg> will automatically forget
uninstalled unavailable packages (since dpkg 1.15.4), but only those that
do not contain user information such as package selections.
=item B<--clear-avail>
Erase the existing information about what packages are available.
=item B<--get-selections> [I<package-name-pattern>...]
Get list of package selections, and write it to stdout.
Without a pattern,
non-installed packages (i.e. those which have been previously purged) will
not be shown.
=item B<--set-selections>
Set package selections using file read from stdin.
This file should be
in the format “I<package> I<state>”, where state is one of
B<install>, B<hold>, B<deinstall> or B<purge>.
Blank lines
and comment lines beginning with ‘B<#>’ are also permitted.
The I<available> file needs to be up-to-date for this command to be
useful, otherwise unknown packages will be ignored with a warning.
See
the B<--update-avail> and B<--merge-avail> commands for more
information.
=item B<--clear-selections>
Set the requested state of every non-essential package to deinstall
(since dpkg 1.13.18).
This is intended to be used immediately before B<--set-selections>,
to deinstall any packages not in list given to B<--set-selections>.
=item B<--yet-to-unpack>
Searches for packages selected for installation, but which for some
reason still haven't been installed.
B<Note>: This command makes use of both the available file and the package
selections.
=item B<--predep-package>
Print a single package which is the target of one or more relevant
pre-dependencies and has itself no unsatisfied pre-dependencies.
If such a package is present, output it as a Packages file entry,
which can be massaged as appropriate.
B<Note>: This command makes use of both the available file and the package
selections.
Returns 0 when a package is printed, 1 when no suitable package is
available and 2 on error.
=item B<--add-architecture> I<architecture>
Add I<architecture> to the list of architectures for which packages can
be installed without using B<--force-architecture> (since dpkg 1.16.2).
The architecture
B<dpkg> is built for (i.e. the output of B<--print-architecture>)
is always part of that list.
=item B<--remove-architecture> I<architecture>
Remove I<architecture> from the list of architectures for which packages
can be installed without using B<--force-architecture>
(since dpkg 1.16.2).
If the
architecture is currently in use in the database then the operation will
be refused, except if B<--force-architecture> is specified.
The
architecture B<dpkg> is built for (i.e. the output of
B<--print-architecture>) can never be removed from that list.
=item B<--print-architecture>
Print architecture of packages B<dpkg> installs (for example, “i386”).
=item B<--print-foreign-architectures>
Print a newline-separated list of the extra architectures B<dpkg> is
configured to allow packages to be installed for (since dpkg 1.16.2).
=item B<--assert-help>
Give help about the B<--assert->I<feature> options (since dpkg 1.21.0).
=item B<--assert->I<feature>
Asserts that B<dpkg> supports the requested feature.
Returns 0 if the feature is fully supported, 1 if the feature is known but
B<dpkg> cannot provide support for it yet, and 2 if the feature is unknown.
The current list of assertable features is:
=over
=item B<support-predepends>
Supports the B<Pre-Depends> field (since dpkg 1.1.0).
=item B<working-epoch>
Supports epochs in version strings (since dpkg 1.4.0.7).
=item B<long-filenames>
Supports long filenames in L<deb(5)> archives (since dpkg 1.4.1.17).
=item B<multi-conrep>
Supports multiple B<Conflicts> and B<Replaces> (since dpkg 1.4.1.19).
=item B<multi-arch>
Supports multi-arch fields and semantics (since dpkg 1.16.2).
=item B<versioned-provides>
Supports versioned B<Provides> (since dpkg 1.17.11).
=item B<protected-field>
Supports the B<Protected> field (since dpkg 1.20.1).
=back
=item B<--validate->I<thing> I<string>
Validate that the I<thing> I<string> has a correct syntax
(since dpkg 1.18.16).
Returns 0 if the I<string> is valid, 1 if the I<string> is invalid but
might be accepted in lax contexts, and 2 if the I<string> is invalid.
The current list of validatable I<thing>s is:
=over
=item B<pkgname>
Validates the given package name (since dpkg 1.18.16).
=item B<trigname>
Validates the given trigger name (since dpkg 1.18.16).
=item B<archname>
Validates the given architecture name (since dpkg 1.18.16).
=item B<version>
Validates the given version (since dpkg 1.18.16).
=back
=item B<--compare-versions> I<ver1> I<op> I<ver2>
Compare version numbers, where I<op> is a binary operator.
B<dpkg>
returns true (B<0>) if the specified condition is satisfied,
and false (B<1>) otherwise.
There are
two groups of operators, which differ in how they treat an empty
I<ver1> or I<ver2>.
These treat an empty version as earlier than any version:
B<lt le eq ne ge gt>.
These treat an empty version as later than any version:
B<lt-nl le-nl ge-nl gt-nl>.
These are provided
only for compatibility with control file syntax: B<E<lt> E<lt>E<lt> E<lt>= = E<gt>= E<gt>E<gt>
E<gt>>.
The B<E<lt>> and B<E<gt>> operators are obsolete and should B<not>
be used, due to confusing semantics.
To illustrate: B<0.1 E<lt> 0.1>
evaluates to true.
=begin disabled
=item B<--command-fd> I<n>
Accept a series of commands on input file descriptor I<n>.
B<Note>: Additional options set on the command line, and through this
file descriptor, are not reset for subsequent commands executed during the
same run.
=end disabled
=item B<-?>, B<--help>
Display a brief help message.
=item B<--force-help>
Give help about the B<--force->I<thing> options.
=item B<-Dh>, B<--debug=help>
Give help about debugging options.
=item B<--version>
Display B<dpkg> version information.
When used with B<--robot>, the output will be the program version number
in a dotted numerical format, with no newline.
=item B<dpkg-deb actions>
See L<dpkg-deb(1)> for more information about the following actions,
and other actions and options not exposed by the B<dpkg> front-end.
=over
=item B<-b>, B<--build> I<directory> [I<archive>|I<directory>]
Build a deb package.
=item B<-c>, B<--contents> I<archive>
List contents of a deb package.
=item B<-e>, B<--control> I<archive> [I<directory>]
Extract control-information from a package.
=item B<-x>, B<--extract> I<archive> I<directory>
Extract the files contained by package.
=item B<-X>, B<--vextract> I<archive> I<directory>
Extract and display the filenames contained by a package.
=item B<-f>, B<--field> I<archive> [I<control-field>...]
Display control field(s) of a package.
=item B<--ctrl-tarfile> I<archive>
Output the control tar-file contained in a Debian package.
=item B<--fsys-tarfile> I<archive>
Output the filesystem tar-file contained by a Debian package.
=item B<-I>, B<--info> I<archive> [I<control-file>...]
Show information about a package.
=back
=item B<dpkg-query actions>
See L<dpkg-query(1)> for more information about the following actions,
and other actions and options not exposed by the B<dpkg> front-end.
=over
=item B<-l>, B<--list> I<package-name-pattern>...
List packages matching given pattern.
=item B<-s>, B<--status> I<package-name>...
Report status of specified package.
=item B<-L>, B<--listfiles> I<package-name>...
List files installed to your system from I<package-name>.
=item B<-S>, B<--search> I<filename-search-pattern>...
Search for a filename from installed packages.
=item B<-p>, B<--print-avail> I<package-name>...
Display details about I<package-name>, as found in
I<%ADMINDIR%/available>.
Users of APT-based frontends
should use B<apt show> I<package-name> instead.
=back
=back
=head1 OPTIONS
All options can be specified both on the command line and in the B<dpkg>
configuration file I<%PKGCONFDIR%/dpkg.cfg> or fragment files (with names
matching this shell pattern '[0-9a-zA-Z_-]*') on the configuration
directory I<%PKGCONFDIR%/dpkg.cfg.d/>.
Each line in the configuration
file is either an option (exactly the same as the command line option but
without leading hyphens) or a comment (if it starts with a ‘B<#>’).
=over
=item B<--abort-after=>I<number>
Change after how many errors B<dpkg> will abort.
The default is 50.
=item B<-B>, B<--auto-deconfigure>
When a package is removed, there is a possibility that another
installed package depended on the removed package.
Specifying this
option will cause automatic deconfiguration of the package which
depended on the removed package.
=item B<-D>I<octal>, B<--debug=>I<octal>
Switch debugging on.
I<octal> is formed by bitwise-ORing desired
values together from the list below (note that these values may change
in future releases).
B<-Dh> or B<--debug=help> display these
debugging values.
Number Description
1 Generally helpful progress information
2 Invocation and status of maintainer scripts
10 Output for each file processed
100 Lots of output for each file processed
20 Output for each configuration file
200 Lots of output for each configuration file
40 Dependencies and conflicts
400 Lots of dependencies/conflicts output
10000 Trigger activation and processing
20000 Lots of output regarding triggers
40000 Silly amounts of output regarding triggers
1000 Lots of drivel about for example the dpkg/info dir
2000 Insane amounts of drivel
=item B<--force->I<things>
=item B<--no-force->I<things>, B<--refuse->I<things>
Force or refuse (B<no-force> and B<refuse> mean the same thing)
to do some things.
I<things> is a comma separated list of things specified below.
B<--force-help> displays a message describing them.
Things marked with (*) are forced by default.
B<Warning>: These options are mostly intended to be used by experts
only.
Using them without fully understanding their effects may break
your whole system.
=over 2
=item B<all>:
Turns on (or off) all force options.
=item B<downgrade>(*):
Install a package, even if newer version of it is already installed.
B<Warning>: At present B<dpkg> does not do any dependency
checking on downgrades and therefore will not warn you
if the downgrade breaks the dependency of some other
package.
This can have serious side effects, downgrading
essential system components can even make your whole
system unusable.
Use with care.
=item B<configure-any>:
Configure also any unpacked but unconfigured packages on which the current
package depends.
=item B<hold>:
Allow automatic installs, upgrades or removals of packages even when marked
to be on “hold”.
B<Note>: When these actions are requested explicitly, the “hold” package
selection state always gets ignored.
=item B<remove-reinstreq>:
Remove a package, even if it's broken and marked to require
reinstallation.
This may, for example, cause parts of the package to
remain on the system, which will then be forgotten by B<dpkg>.
=item B<remove-protected>:
Remove, even if the package is considered protected (since dpkg 1.20.1).
Protected packages contain mostly important system boot infrastructure or
are used for custom system-local meta-packages.
Removing them might cause the whole system to be unable to boot or lose
required functionality to operate, so use with caution.
=item B<remove-essential>:
Remove, even if the package is considered essential.
Essential packages contain mostly very basic Unix commands, required for
the packaging system, for the operation of the system in general or during
boot (although the latter should be converted to protected packages instead).
Removing them might cause the whole system to stop working,
so use with caution.
=item B<depends>:
Turn all dependency problems into warnings.
This affects the B<Pre-Depends> and B<Depends> fields.
=item B<depends-version>:
Don't care about versions when checking dependencies.
This affects the B<Pre-Depends> and B<Depends> fields.
=item B<breaks>:
Install, even if this would break another package (since dpkg 1.14.6).
This affects the B<Breaks> field.
=item B<conflicts>:
Install, even if it conflicts with another package.
This is dangerous,
for it will usually cause overwriting of some files.
This affects the B<Conflicts> field.
=item B<confmiss>:
Always install the missing conffile without prompting.
This is dangerous,
since it means not preserving a change (removing) made to the file.
=item B<confnew>:
If a conffile has been modified and the version in the package did change,
always install the new version without prompting, unless the
B<--force-confdef> is also specified, in which case the default
action is preferred.
=item B<confold>:
If a conffile has been modified and the version in the package did change,
always keep the old version without prompting, unless the
B<--force-confdef> is also specified, in which case the default
action is preferred.
=item B<confdef>:
If a conffile has been modified and the version in the package did change,
always choose the default action without prompting.
If there is no default
action it will stop to ask the user unless B<--force-confnew> or
B<--force-confold> is also given, in which case it will use
that to decide the final action.
=item B<confask>:
If a conffile has been modified always offer to replace it with the
version in the package, even if the version in the package did not
change (since dpkg 1.15.8).
If any of B<--force-confnew>,
B<--force-confold>, or B<--force-confdef> is also given,
it will be used to decide the final action.
=item B<overwrite>:
Overwrite one package's file with another's file.
=item B<overwrite-dir>:
Overwrite one package's directory with another's file.
=item B<overwrite-diverted>:
Overwrite a diverted file with an undiverted version.
=item B<statoverride-add>:
Overwrite an existing stat override when adding it (since dpkg 1.19.5).
=item B<statoverride-remove>:
Ignore a missing stat override when removing it (since dpkg 1.19.5).
=item B<security-mac>(*):
Use platform-specific Mandatory Access Controls (MAC) based security when
installing files into the filesystem (since dpkg 1.19.5).
On Linux systems the implementation uses SELinux.
=item B<unsafe-io>:
Do not perform safe I/O operations when unpacking (since dpkg 1.15.8.6).
Currently this
implies not performing file system syncs before file renames, which is
known to cause substantial performance degradation on some file systems,
unfortunately the ones that require the safe I/O on the first place due
to their unreliable behaviour causing zero-length files on abrupt
system crashes.
I<Note>: For ext4, the main offender, consider using instead the
mount option B<nodelalloc>, which will fix both the performance
degradation and the data safety issues, the latter by making the file
system not produce zero-length files on abrupt system crashes with
any software not doing syncs before atomic renames.
B<Warning>: Using this option might improve performance at the cost of
losing data, use with care.
=item B<script-chrootless>:
Run maintainer scripts without L<chroot(2)>ing into B<instdir> even
if the package does not support this mode of operation (since dpkg 1.18.5).
B<Warning>: This can destroy your host system, use with extreme care.
=item B<architecture>:
Process even packages with wrong or no architecture.
=item B<bad-version>:
Process even packages with wrong versions (since dpkg 1.16.1).
=item B<bad-path>:
B<PATH> is missing important programs, so problems are likely.
=item B<not-root>:
Try to (de)install things even when not root.
=item B<bad-verify>:
Install a package even if it fails authenticity check.
=back
=item B<--ignore-depends>=I<package>,...
Ignore dependency-checking for specified packages (actually, checking is
performed, but only warnings about conflicts are given, nothing else).
This affects the B<Pre-Depends>, B<Depends> and B<Breaks> fields.
=item B<--no-act>, B<--dry-run>, B<--simulate>
Do everything which is supposed to be done, but don't write any
changes.
This is used to see what would happen with the specified
action, without actually modifying anything.
Be sure to give B<--no-act> before the action-parameter, or you might
end up with undesirable results (e.g. B<dpkg --purge foo --no-act> will
first purge package “foo” and then try to purge package ”--no-act”, even
though you probably expected it to actually do nothing).
=item B<-R>, B<--recursive>
Recursively handle all regular files matching pattern B<*.deb>
found at specified directories and all of its subdirectories.
This can
be used with B<-i>, B<-A>, B<--install>, B<--unpack> and
B<--record-avail> actions.
=item B<-G>
Don't install a package if a newer version of the same package is already
installed.
This is an alias of B<--refuse-downgrade>.
=item B<--admindir=>I<dir>
Set the administrative directory to I<directory>.
This directory contains many files that give information about status of
installed or uninstalled packages, etc.
Defaults to «I<%ADMINDIR%>» if B<DPKG_ADMINDIR> has not been set.
=item B<--instdir=>I<dir>
Set the installation directory, which refers to the directory where
packages are to be installed.
B<instdir> is also the directory passed
to L<chroot(2)> before running package's installation scripts, which
means that the scripts see B<instdir> as a root directory.
Defaults to «I</>».
=item B<--root=>I<dir>
Set the root directory to B<directory>, which sets the installation
directory to «I<dir>» and the administrative
directory to «I<dir>B<%ADMINDIR%>».
=item B<-O>, B<--selected-only>
Only process the packages that are selected for installation.
The
actual marking is done with B<dselect> or by B<dpkg>, when it
handles packages.
For example, when a package is removed, it will
be marked selected for deinstallation.
=item B<-E>, B<--skip-same-version>
Don't install the package if the same version and architecture
of the package is already installed.
Since dpkg 1.21.10, the architecture is also taken into account,
which makes it possible to cross-grade packages or install additional
co-installable instances with the same version, but different architecture.
=item B<--pre-invoke=>I<command>
=item B<--post-invoke=>I<command>
Set an invoke hook I<command> to be run via “%DPKG_DEFAULT_SHELL% -c” before or
after the B<dpkg> run for the I<unpack>, I<configure>, I<install>,
I<triggers-only>,
I<remove> and
I<purge>
actions (since dpkg 1.15.4), and
I<add-architecture> and
I<remove-architecture>
actions (since dpkg 1.17.19).
This
option can be specified multiple times.
The order the options are specified
is preserved, with the ones from the configuration files taking precedence.
The environment variable B<DPKG_HOOK_ACTION> is set for the hooks to the
current B<dpkg> action.
B<Note>: Front-ends might call B<dpkg> several
times per invocation, which might run the hooks more times than expected.
=item B<--path-exclude=>I<glob-pattern>
=item B<--path-include=>I<glob-pattern>
Set I<glob-pattern> as a path filter, either by excluding or re-including
previously excluded paths matching the specified patterns during install
(since dpkg 1.15.8).
B<Warning>: Take into account that depending on the excluded paths you
might completely break your system, use with caution.
The glob patterns use the same wildcards used in the shell, were
‘*’ matches any sequence of characters, including the empty string
and also ‘/’.
For example, «I</usr/*/READ*>» matches
«I</usr/share/doc/package/README>».
As usual, ‘?’ matches any single character (again, including ‘/’).
And ‘[’
starts a character class, which can contain a list of characters, ranges
and complementations.
See L<glob(7)> for detailed information about
globbing.
B<Note>: The current implementation might re-include more directories
and symlinks than needed, in particular when there is a more specific
re-inclusion, to be on the safe side and avoid possible unpack failures;
future work might fix this.
This can be used to remove all paths except some particular ones; a typical
case is:
--path-exclude=/usr/share/doc/*
--path-include=/usr/share/doc/*/copyright
to remove all documentation files except the copyright files.
These two options can be specified multiple times, and interleaved with
each other.
Both are processed in the given order, with the last rule that
matches a file name making the decision.
The filters are applied when unpacking the binary packages, and as such
only have knowledge of the type of object currently being filtered
(e.g. a normal file or a directory) and have not visibility of what
objects will come next.
Because these filters have side effects (in contrast to L<find(1)>
filters), excluding an exact pathname that happens to be a directory object
like I</usr/share/doc> will not have the desired result, and only that
pathname will be excluded (which could be automatically reincluded if the
code sees the need).
Any subsequent files contained within that directory will fail to unpack.
B<Hint>: make sure the globs are not expanded by your shell.
=item B<--verify-format> I<format-name>
Sets the output format for the B<--verify> command (since dpkg 1.17.2).
The only currently supported output format is B<rpm>, which consists
of a line for every path that failed any check.
These lines have the following format:
Z<>
B<missing > [B<c>] I<pathname> [B<(>I<error-message>B<)>]
B<??5??????> [B<c>] I<pathname>
The first 9 characters are used to report the checks result,
either a literal B<missing> when the file is not present or its metadata
cannot be fetched,
or one of the following special characters that report the result for each
check:
=over
=item ‘B<?>’
Implies the check could not be done (lack of support, file permissions, etc).
=item ‘B<.>’
Implies the check passed.
=item ‘I<A-Za-z0-9>’
Implies a specific check failed.
The following positions and alphanumeric characters are currently supported:
=over
=item 1 ‘B<?>’
These checks are currently not supported, will always be ‘B<?>’.
=item 2 ‘B<M>’
The file mode check failed (since dpkg 1.21.0).
Because pathname metadata is currently not tracked, this check can only be
partially emulated via a very simple heuristic for pathnames that have a
known digest, which implies they should be regular files, where the check
will fail if the pathname is not a regular file on the filesystem.
This check will currently never succeed as it does not have enough
information available.
=item 3 ‘B<5>’
The digest check failed, which means the file contents have changed.
This is only an integrity check and should not be considered as any
kind of security verification.
=item 4-9 ‘B<?>’
These checks are currently not supported, will always be ‘B<?>’.
=back
=back
The line is followed by a space and an attribute character.
The following attribute character is supported:
=over
=item ‘B<c>’
The pathname is a conffile.
=back
Finally followed by another space and the pathname.
In case the entry was of the B<missing> type, and the file was not actually
present on the filesystem, then the line is followed by a space and the
error message enclosed within parenthesis.
=item B<--status-fd> I<n>
Send machine-readable package status and progress information to file
descriptor I<n>.
This option can be specified multiple times.
The
information is generally one record per line, in one of the following
forms:
=over
=item B<status:> I<package>B<:> I<status>
Package status changed; I<status> is as in the status file.
=item B<status:> I<package> B<: error :> I<extended-error-message>
An error occurred.
Any possible newlines in I<extended-error-message>
will be converted to spaces before output.
=item B<status:> I<file> B<: conffile-prompt : '>I<real-old>B<' '>I<real-new>B<'> I<useredited> I<distedited>
User is being asked a conffile question.
=item B<processing:> I<stage>B<:> I<package>
Sent just before a processing stage starts.
I<stage> is one of
B<upgrade>, B<install> (both sent before unpacking),
B<configure>, B<trigproc>, B<disappear>, B<remove>, B<purge>.
=back
=item B<--status-logger>=I<command>
Send machine-readable package status and progress information to the
shell I<command>'s standard input, to be run via “%DPKG_DEFAULT_SHELL% -c”
(since dpkg 1.16.0).
This option can be specified multiple times.
The output format used is the same as in B<--status-fd>.
=item B<--log=>I<filename>
Log status change updates and actions to I<filename>, instead of
the default I<%LOGDIR%/dpkg.log>.
If this option is given multiple times, the last filename is used.
Log messages are of the form:
=over
=item YYYY-MM-DD HH:MM:SS B<startup> I<type> I<command>
For each dpkg invocation where I<type> is B<archives> (with a
I<command> of B<unpack> or B<install>) or B<packages>
(with a I<command> of B<configure>, B<triggers-only>,
B<remove> or B<purge>).
=item YYYY-MM-DD HH:MM:SS B<status> I<state> I<pkg> I<installed-version>
For status change updates.
=item YYYY-MM-DD HH:MM:SS I<action> I<pkg> I<installed-version> I<available-version>
For actions where I<action> is one of B<install>, B<upgrade>,
B<configure>, B<trigproc>, B<disappear>, B<remove> or B<purge>.
=item YYYY-MM-DD HH:MM:SS B<conffile> I<filename> I<decision>
For conffile changes where I<decision> is either B<install> or
B<keep>.
=back
=item B<--robot>
Use a machine-readable output format.
This provides an interface for programs
that need to parse the output of some of the commands that do not otherwise
emit a machine-readable output format.
No localization will be used, and the
output will be modified to make it easier to parse.
The only currently supported command is B<--version>.
=item B<--no-pager>
Disables the use of any pager when showing information (since dpkg 1.19.2).
=item B<--no-debsig>
Do not try to verify package signatures.
=item B<--no-triggers>
Do not run any triggers in this run (since dpkg 1.14.17), but activations
will still be recorded.
If used with B<--configure> I<package> or
B<--triggers-only> I<package> then the named package postinst
will still be run even if only a triggers run is needed.
Use of this option
may leave packages in the improper B<triggers-awaited> and
B<triggers-pending> states.
This can be fixed later by running:
B<dpkg --configure --pending>.
=item B<--triggers>
Cancels a previous B<--no-triggers> (since dpkg 1.14.17).
=back
=head1 EXIT STATUS
=over
=item B<0>
The requested action was successfully performed.
Or a check or assertion command returned true.
=item B<1>
A check or assertion command returned false.
=item B<2>
Fatal or unrecoverable error due to invalid command-line usage, or
interactions with the system, such as accesses to the database,
memory allocations, etc.
=back
=head1 ENVIRONMENT
=head2 External environment
=over
=item B<PATH>
This variable is expected to be defined in the environment and point to
the system paths where several required programs are to be found.
If it's
not set or the programs are not found, B<dpkg> will abort.
=item B<HOME>
If set, B<dpkg> will use it as the directory from which to read the user
specific configuration file.
=item B<TMPDIR>
If set, B<dpkg> will use it as the directory in which to create
temporary files and directories.
=item B<SHELL>
The program B<dpkg> will execute when starting a new interactive shell,
or when spawning a command via a shell.
=item B<PAGER>
=item B<DPKG_PAGER>
The program B<dpkg> will execute when running a pager,
which will be executed with «B<$SHELL -c>»,
for example when displaying the conffile differences.
If B<SHELL> is not set, «B<%DPKG_DEFAULT_SHELL%>» will be used instead.
The B<DPKG_PAGER> overrides the B<PAGER> environment variable
(since dpkg 1.19.2).
=item B<DPKG_COLORS>
Sets the color mode (since dpkg 1.18.5).
The currently accepted values are: B<auto> (default), B<always> and
B<never>.
=item B<DPKG_DEBUG>
Sets the debug mask (since dpkg 1.21.10) from an octal value.
The currently accepted flags are described in the B<--debug> option.
=item B<DPKG_FORCE>
Sets the force flags (since dpkg 1.19.5).
When this variable is present, no built-in force defaults will be applied.
If the variable is present but empty, all force flags will be disabled.
=item B<DPKG_ADMINDIR>
If set and the B<--admindir> or B<--root> options have not been
specified, it will be used as the B<dpkg> administrative directory
(since dpkg 1.20.0).
=item B<DPKG_FRONTEND_LOCKED>
Set by a package manager frontend to notify dpkg that it should not acquire
the frontend lock (since dpkg 1.19.1).
=back
=head2 Internal environment
=over
=item B<LESS>
Defined by B<dpkg> to “B<-FRSXMQ>”, if not already set, when
spawning a pager (since dpkg 1.19.2).
To change the default behavior, this variable can be preset to some other
value including an empty string, or the B<PAGER> or B<DPKG_PAGER>
variables can be set to disable specific options with «B<-+>», for
example B<DPKG_PAGER="less -+F">.
=item B<DPKG_ROOT>
Defined by B<dpkg> on the maintainer script environment to indicate
which installation to act on (since dpkg 1.18.5).
The value is intended to be prepended to any path maintainer scripts
operate on.
During normal operation, this variable is empty.
When installing packages into a different B<instdir>, B<dpkg>
normally invokes maintainer scripts using L<chroot(2)> and leaves
this variable empty, but if B<--force-script-chrootless> is
specified then the L<chroot(2)> call is skipped and B<instdir>
is non-empty.
=item B<DPKG_ADMINDIR>
Defined by B<dpkg> on the maintainer script environment to indicate
the B<dpkg> administrative directory to use (since dpkg 1.16.0).
This variable is always set to the current B<--admindir> value.
=item B<DPKG_FORCE>
Defined by B<dpkg> on the subprocesses environment to all the currently
enabled force option names separated by commas (since dpkg 1.19.5).
=item B<DPKG_SHELL_REASON>
Defined by B<dpkg> on the shell spawned on the conffile prompt to
examine the situation (since dpkg 1.15.6).
Current valid value: B<conffile-prompt>.
=item B<DPKG_CONFFILE_OLD>
Defined by B<dpkg> on the shell spawned on the conffile prompt to
examine the situation (since dpkg 1.15.6).
Contains the path to the old conffile.
=item B<DPKG_CONFFILE_NEW>
Defined by B<dpkg> on the shell spawned on the conffile prompt to
examine the situation (since dpkg 1.15.6).
Contains the path to the new conffile.
=item B<DPKG_HOOK_ACTION>
Defined by B<dpkg> on the shell spawned when executing a hook action
(since dpkg 1.15.4).
Contains the current B<dpkg> action.
=item B<DPKG_RUNNING_VERSION>
Defined by B<dpkg> on the maintainer script environment to the
version of the currently running B<dpkg> instance (since dpkg 1.14.17).
=item B<DPKG_MAINTSCRIPT_PACKAGE>
Defined by B<dpkg> on the maintainer script environment to the
(non-arch-qualified) package name being handled (since dpkg 1.14.17).
=item B<DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT>
Defined by B<dpkg> on the maintainer script environment to the
package reference count, i.e. the number of package instances with
a state greater than B<not-installed> (since dpkg 1.17.2).
=item B<DPKG_MAINTSCRIPT_ARCH>
Defined by B<dpkg> on the maintainer script environment to the
architecture the package got built for (since dpkg 1.15.4).
=item B<DPKG_MAINTSCRIPT_NAME>
Defined by B<dpkg> on the maintainer script environment to the
name of the script running, one of B<preinst>, B<postinst>,
B<prerm> or B<postrm> (since dpkg 1.15.7).
=item B<DPKG_MAINTSCRIPT_DEBUG>
Defined by B<dpkg> on the maintainer script environment to a value
(‘B<0>’ or ‘B<1>’) noting whether debugging has been
requested (with the B<--debug> option) for the maintainer scripts
(since dpkg 1.18.4).
=back
=head1 FILES
=over
=item I<%PKGCONFDIR%/dpkg.cfg.d/[0-9a-zA-Z_-]*>
Configuration fragment files (since dpkg 1.15.4).
=item I<%PKGCONFDIR%/dpkg.cfg>
Configuration file with default options.
=item I<%LOGDIR%/dpkg.log>
Default log file (see I<%PKGCONFDIR%/dpkg.cfg> and option
B<--log>).
=back
The other files listed below are in their default directories, see option
B<--admindir> to see how to change locations of these files.
=over
=item I<%ADMINDIR%/available>
List of available packages.
=item I<%ADMINDIR%/status>
Statuses of available packages.
This file contains information about
whether a package is marked for removing or not, whether it is
installed or not, etc.
See section L</INFORMATION ABOUT PACKAGES>
for more info.
The status file is backed up daily in I<%BACKUPSDIR%>.
It can be
useful if it's lost or corrupted due to filesystems troubles.
=back
The format and contents of a binary package are described in L<deb(5)>.
=head2 Filesystem filenames
During unpacking and configuration B<dpkg> uses various filenames for
backup and rollback purposes.
The following is a simplified explanation of how these filenames get used
during package installation.
=over
=item F<*.dpkg-new>
During unpack, B<dpkg> extracts new filesystem objects into
I<pathname>B<.dpkg-new>
(except for existing directories or symlinks to directories which get skipped),
once that is done and after having performed backups of the old objects,
the objects get renamed to I<pathname>.
=item F<*.dpkg-tmp>
During unpack, B<dpkg> makes backups of the old filesystem objects into
I<pathname>B<.dpkg-tmp> after extracting the new objects.
These backups are performed as either a rename for directories
(but only if they switch file type),
a new symlink copy for symlinks,
or a hard link for any other filesystem object,
except for conffiles which get no backups because they are processed
at a later stage.
In case of needing to rollback, these backups get used to restore the
previous contents of the objects.
These get removed automatically after the installation is complete.
=item F<*.dpkg-old>
During configuration, when installing a new version,
B<dpkg> can make a backup of the previous modified conffile into
I<pathname>B<.dpkg-old>.
=item F<*.dpkg-dist>
During configuration, when keeping the old version,
B<dpkg> can make a backup of the new unmodified conffile into
I<pathname>B<.dpkg-dist>.
=back
=head1 SECURITY
Any operation that needs write access to the database or the filesystem
is considered a privileged operation that might allow root escalation.
These operations must never be delegated to an untrusted user or be done
on untrusted packages, as that might allow root access to the system.
Some operations (such as package verification) might need root privileges
to be able to access files on the filesystem that would otherwise be
inaccessible due to restricted permissions, but should otherwise work
normally and produce appropriate messages in those cases.
Query operations should never require root, and delegating their execution
to unprivileged users via some gain-root command can have security
implications (such as privilege escalation), for example when a pager is
automatically invoked by the tool.
See also the B<SECURITY> section of the L<dpkg-deb(1)> and L<dpkg-split(1)>
manual pages.
=head1 BUGS
B<--no-act> usually gives less information than might be helpful.
=head1 EXAMPLES
To list installed packages related to the editor L<vi(1)> (note that
B<dpkg-query> does not load the I<available> file anymore by
default, and the B<dpkg-query> B<--load-avail> option should
be used instead for that):
=over
dpkg -l '*vi*'
=back
To see the entries in I<%ADMINDIR%/available> of two packages:
=over
dpkg --print-avail vim neovim | less
=back
To search the listing of packages yourself:
=over
dpkg --print-avail | less
=back
To remove an installed neovim package:
=over
dpkg -r neovim
=back
To install a package, you first need to find it in an archive or media disc.
When using an archive based on a pool structure,
knowing the archive area and the name of the package is enough to infer
the pathname:
=over
dpkg -i /media/bdrom/pool/main/v/vim/vim_9.0.2018-1_amd64.deb
=back
To make a local copy of the package selection states:
=over
dpkg --get-selections >myselections
=back
You might transfer this file to another computer, and after having updated
the I<available> file there with your package manager frontend of choice
(see L<https://wiki.debian.org/Teams/Dpkg/FAQ#set-selections> for more
details), for example:
=over
apt-cache dumpavail | dpkg --merge-avail
=back
you can install it with:
=over
dpkg --clear-selections
dpkg --set-selections <myselections
=back
Note that this will not actually install or remove anything, but just
set the selection state on the requested packages.
You will need some
other application to actually download and install the requested
packages.
For example, run B<apt-get dselect-upgrade>.
Ordinarily, you will find that L<dselect(1)> provides a more
convenient way to modify the package selection states.
=head1 ADDITIONAL FUNCTIONALITY
Additional functionality can be gained by installing any of the
following packages: B<apt>, B<aptitude> and B<debsig-verify>.
=head1 SEE ALSO
L<aptitude(8)>,
L<apt(8)>,
L<dselect(1)>,
L<dpkg-deb(1)>,
L<dpkg-query(1)>,
L<deb(5)>,
L<deb-control(5)>,
L<dpkg.cfg(5)>,
and
L<dpkg-reconfigure(8)>.
=head1 AUTHORS
See I<%PKGDOCDIR%/THANKS> for the list of people who have
contributed to B<dpkg>.
|