1dpkg-deb(1) dpkg suite dpkg-deb(1)
2
3
4
6 dpkg-deb - Debian package archive (.deb) manipulation tool
7
9 dpkg-deb [option...] command
10
12 dpkg-deb packs, unpacks and provides information about Debian archives.
13
14 Use dpkg to install and remove packages from your system.
15
16 You can also invoke dpkg-deb by calling dpkg with whatever options you
17 want to pass to dpkg-deb. dpkg will spot that you wanted dpkg-deb and
18 run it for you.
19
20 For most commands taking an input archive argument, the archive can be
21 read from standard input if the archive name is given as a single minus
22 character («-»); otherwise lack of support will be documented in their
23 respective command description.
24
26 -b, --build binary-directory [archive|directory]
27 Creates a debian archive from the filesystem tree stored in binary-
28 directory. binary-directory must have a DEBIAN subdirectory, which
29 contains the control information files such as the control file
30 itself. This directory will not appear in the binary package's
31 filesystem archive, but instead the files in it will be put in the
32 binary package's control information area.
33
34 Unless you specify --nocheck, dpkg-deb will read DEBIAN/control and
35 parse it. It will check the file for syntax errors and other
36 problems, and display the name of the binary package being built.
37 dpkg-deb will also check the permissions of the maintainer scripts
38 and other files found in the DEBIAN control information directory.
39
40 If no archive is specified then dpkg-deb will write the package
41 into the file binary-directory.deb.
42
43 If the archive to be created already exists it will be overwritten.
44
45 If the second argument is a directory then dpkg-deb will write to
46 the file directory/package_version_arch.deb. When a target
47 directory is specified, rather than a file, the --nocheck option
48 may not be used (since dpkg-deb needs to read and parse the package
49 control file to determine which filename to use).
50
51 -I, --info archive [control-file-name...]
52 Provides information about a binary package archive.
53
54 If no control-file-names are specified then it will print a summary
55 of the contents of the package as well as its control file.
56
57 If any control-file-names are specified then dpkg-deb will print
58 them in the order they were specified; if any of the components
59 weren't present it will print an error message to stderr about each
60 one and exit with status 2.
61
62 -W, --show archive
63 Provides information about a binary package archive in the format
64 specified by the --showformat argument. The default format displays
65 the package's name and version on one line, separated by a
66 tabulator.
67
68 -f, --field archive [control-field-name...]
69 Extracts control file information from a binary package archive.
70
71 If no control-field-names are specified then it will print the
72 whole control file.
73
74 If any are specified then dpkg-deb will print their contents, in
75 the order in which they appear in the control file. If more than
76 one control-field-name is specified then dpkg-deb will precede each
77 with its field name (and a colon and space).
78
79 No errors are reported for fields requested but not found.
80
81 -c, --contents archive
82 Lists the contents of the filesystem tree archive portion of the
83 package archive. It is currently produced in the format generated
84 by tar's verbose listing.
85
86 -x, --extract archive directory
87 Extracts the filesystem tree from a package archive into the
88 specified directory.
89
90 Note that extracting a package to the root directory will not
91 result in a correct installation! Use dpkg to install packages.
92
93 directory (but not its parents) will be created if necessary, and
94 its permissions modified to match the contents of the package.
95
96 -X, --vextract archive directory
97 Is like --extract (-x) with --verbose (-v) which prints a listing
98 of the files extracted as it goes.
99
100 -R, --raw-extract archive directory
101 Extracts the filesystem tree from a package archive into a
102 specified directory, and the control information files into a
103 DEBIAN subdirectory of the specified directory (since dpkg 1.16.1).
104
105 The target directory (but not its parents) will be created if
106 necessary.
107
108 The input archive is not (currently) processed sequentially, so
109 reading it from standard input («-») is not supported.
110
111 --ctrl-tarfile archive
112 Extracts the control data from a binary package and sends it to
113 standard output in tar format (since dpkg 1.17.14). Together with
114 tar(1) this can be used to extract a particular control file from a
115 package archive. The input archive will always be processed
116 sequentially.
117
118 --fsys-tarfile archive
119 Extracts the filesystem tree data from a binary package and sends
120 it to standard output in tar format. Together with tar(1) this can
121 be used to extract a particular file from a package archive. The
122 input archive will always be processed sequentially.
123
124 -e, --control archive [directory]
125 Extracts the control information files from a package archive into
126 the specified directory.
127
128 If no directory is specified then a subdirectory DEBIAN in the
129 current directory is used.
130
131 The target directory (but not its parents) will be created if
132 necessary.
133
134 -?, --help
135 Show the usage message and exit.
136
137 --version
138 Show the version and exit.
139
141 --showformat=format
142 This option is used to specify the format of the output --show will
143 produce. The format is a string that will be output for each
144 package listed.
145
146 The string may reference any status field using the “${field-name}”
147 form, a list of the valid fields can be easily produced using -I on
148 the same package. A complete explanation of the formatting options
149 (including escape sequences and field tabbing) can be found in the
150 explanation of the --showformat option in dpkg-query(1).
151
152 The default for this field is “${Package}\t${Version}\n”.
153
154 -zcompress-level
155 Specify which compression level to use on the compressor backend,
156 when building a package (default is 9 for gzip, 6 for xz). The
157 accepted values are 0-9 with: 0 being mapped to compressor none for
158 gzip. Before dpkg 1.16.2 level 0 was equivalent to compressor none
159 for all compressors.
160
161 -Scompress-strategy
162 Specify which compression strategy to use on the compressor
163 backend, when building a package (since dpkg 1.16.2). Allowed
164 values are none (since dpkg 1.16.4), filtered, huffman, rle and
165 fixed for gzip (since dpkg 1.17.0) and extreme for xz.
166
167 -Zcompress-type
168 Specify which compression type to use when building a package.
169 Allowed values are gzip, xz (since dpkg 1.15.6), and none (default
170 is xz).
171
172 --[no-]uniform-compression
173 Specify that the same compression parameters should be used for all
174 archive members (i.e. control.tar and data.tar; since dpkg 1.17.6).
175 Otherwise only the data.tar member will use those parameters. The
176 only supported compression types allowed to be uniformly used are
177 none, gzip and xz. The --no-uniform-compression option disables
178 uniform compression (since dpkg 1.19.0). Uniform compression is
179 the default (since dpkg 1.19.0).
180
181 --threads-max=threads
182 Sets the maximum number of threads allowed for compressors that
183 support multi-threaded operations (since dpkg 1.21.9).
184
185 --root-owner-group
186 Set the owner and group for each entry in the filesystem tree data
187 to root with id 0 (since dpkg 1.19.0).
188
189 Note: This option can be useful for rootless builds (see
190 rootless-builds.txt), but should not be used when the entries have
191 an owner or group that is not root. Support for these will be
192 added later in the form of a meta manifest.
193
194 --deb-format=format
195 Set the archive format version used when building (since dpkg
196 1.17.0). Allowed values are 2.0 for the new format, and 0.939000
197 for the old one (default is 2.0).
198
199 The old archive format is less easily parsed by non-Debian tools
200 and is now obsolete; its only use is when building packages to be
201 parsed by versions of dpkg older than 0.93.76 (September 1995),
202 which was released as i386 a.out only.
203
204 --nocheck
205 Inhibits dpkg-deb --build's usual checks on the proposed contents
206 of an archive. You can build any archive you want, no matter how
207 broken, this way.
208
209 -v, --verbose
210 Enables verbose output (since dpkg 1.16.1). This currently only
211 affects --extract making it behave like --vextract.
212
213 -D, --debug
214 Enables debugging output. This is not very interesting.
215
217 0 The requested action was successfully performed.
218
219 2 Fatal or unrecoverable error due to invalid command-line usage, or
220 interactions with the system, such as accesses to the database,
221 memory allocations, etc.
222
224 DPKG_DEB_THREADS_MAX
225 Sets the maximum number of threads allowed for compressors that
226 support multi-threaded operations (since dpkg 1.21.9).
227
228 The --threads-max option overrides this value.
229
230 DPKG_COLORS
231 Sets the color mode (since dpkg 1.18.5). The currently accepted
232 values are: auto (default), always and never.
233
234 TMPDIR
235 If set, dpkg-deb will use it as the directory in which to create
236 temporary files and directories.
237
238 SOURCE_DATE_EPOCH
239 If set, it will be used as the timestamp (as seconds since the
240 epoch) in the deb(5)'s ar(5) container and used to clamp the mtime
241 in the tar(5) file entries.
242
244 Do not attempt to use just dpkg-deb to install software! You must use
245 dpkg proper to ensure that all the files are correctly placed and the
246 package's scripts run and its status and contents recorded.
247
249 dpkg-deb -I package1.deb package2.deb does the wrong thing.
250
251 There is no authentication on .deb files; in fact, there isn't even a
252 straightforward checksum. (Higher level tools like APT support
253 authenticating .deb packages retrieved from a given repository, and
254 most packages nowadays provide an md5sum control file generated by
255 debian/rules. Though this is not directly supported by the lower level
256 tools.)
257
259 /usr/share/doc/dpkg/spec/rootless-builds.txt, deb(5), deb-control(5),
260 dpkg(1), dselect(1).
261
262
263
2641.21.9 2022-07-01 dpkg-deb(1)