1 # dpkg manual page - dpkg-deb(1)
3 # Copyright © 1995-1996 Ian Jackson <ijackson@chiark.greenend.org.uk>
4 # Copyright © 1999 Wichert Akkerman <wakkerma@debian.org>
5 # Copyright © 2006 Frank Lichtenheld <djpig@debian.org>
6 # Copyright © 2007-2015 Guillem Jover <guillem@debian.org>
8 # This is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <https://www.gnu.org/licenses/>.
25 dpkg-deb - Debian package archive (.deb) manipulation tool
30 [I<option>...] I<command>
35 packs, unpacks and provides information about Debian archives.
39 to install and remove packages from your system.
45 with whatever options you want to pass to
48 will spot that you wanted
52 For most commands taking an input archive argument, the archive can be
53 read from standard input if the archive name is given as a single minus
54 character («B<->»); otherwise lack of support will be documented in
55 their respective command description.
61 =item B<-b>, B<--build> I<binary-directory> [I<archive>|I<directory>]
63 Creates a debian archive from the filesystem tree stored in
68 subdirectory, which contains the control information files such
69 as the control file itself.
72 appear in the binary package's filesystem archive, but instead
73 the files in it will be put in the binary package's control
77 B<--nocheck>, B<dpkg-deb>
81 It will check the file for syntax errors and other problems,
82 and display the name of the binary package being built.
84 will also check the permissions of the maintainer scripts and other
87 control information directory.
93 will write the package into the file
94 I<binary-directory>B<.deb>.
96 If the archive to be created already exists it will be overwritten.
98 If the second argument is a directory then
100 will write to the file
101 I<directory>B</>I<package>B<_>I<version>B<_>I<arch>B<.deb.>
102 When a target directory is specified, rather than a file, the
104 option may not be used (since
106 needs to read and parse the package control file to determine which
109 =item B<-I>, B<--info> I<archive> [I<control-file-name>...]
111 Provides information about a binary package archive.
114 I<control-file-name>s
115 are specified then it will print a summary of the contents of the
116 package as well as its control file.
119 I<control-file-name>s
122 will print them in the order they were specified; if any of the
123 components weren't present it will print an error message to stderr
124 about each one and exit with status 2.
126 =item B<-W>, B<--show> I<archive>
128 Provides information about a binary package archive in the format
132 The default format displays the package's name and version
133 on one line, separated by a tabulator.
135 =item B<-f>, B<--field> I<archive> [I<control-field-name>...]
137 Extracts control file information from a binary package archive.
140 I<control-field-name>s
141 are specified then it will print the whole control file.
143 If any are specified then
145 will print their contents, in the order in which they appear in the
148 I<control-field-name>
151 will precede each with its field name (and a colon and space).
153 No errors are reported for fields requested but not found.
155 =item B<-c>, B<--contents> I<archive>
157 Lists the contents of the filesystem tree archive portion of the
159 It is currently produced in the format generated by
163 =item B<-x>, B<--extract> I<archive> I<directory>
165 Extracts the filesystem tree from a package archive into the specified
168 Note that extracting a package to the root directory will
170 result in a correct installation!
176 (but not its parents) will be created if necessary, and its permissions
177 modified to match the contents of the package.
179 =item B<-X>, B<--vextract> I<archive> I<directory>
185 which prints a listing of the files extracted as it goes.
187 =item B<-R>, B<--raw-extract> I<archive> I<directory>
189 Extracts the filesystem tree from a package archive into a specified
190 directory, and the control information files into a
192 subdirectory of the specified directory (since dpkg 1.16.1).
194 The target directory (but not its parents) will be created if necessary.
196 The input archive is not (currently) processed sequentially, so reading
197 it from standard input («B<->») is B<not> supported.
199 =item B<--ctrl-tarfile> I<archive>
201 Extracts the control data from a binary package and sends it to standard
204 format (since dpkg 1.17.14).
207 this can be used to extract a particular control file from a package archive.
208 The input archive will always be processed sequentially.
210 =item B<--fsys-tarfile> I<archive>
212 Extracts the filesystem tree data from a binary package and sends it
213 to standard output in
218 this can be used to extract a particular file from a package archive.
219 The input archive will always be processed sequentially.
221 =item B<-e>, B<--control> I<archive> [I<directory>]
223 Extracts the control information files from a package archive into the
226 If no directory is specified then a subdirectory
228 in the current directory is used.
230 The target directory (but not its parents) will be created if
233 =item B<-?>, B<--help>
235 Show the usage message and exit.
239 Show the version and exit.
247 =item B<--showformat=>I<format>
249 This option is used to specify the format of the output B<--show>
251 The format is a string that will be output for each package
254 The string may reference any status field using the
255 “${I<field-name>}” form, a list of the valid fields can be easily
259 A complete explanation of the formatting options
260 (including escape sequences and field tabbing) can be found in the
261 explanation of the B<--showformat> option in
264 The default for this field is “${Package}\t${Version}\n”.
266 =item B<-z>I<compress-level>
268 Specify which compression level to use on the compressor backend, when
269 building a package (default is 9 for gzip, 6 for xz, 3 for zstd).
270 The accepted values are compressor specific.
271 For gzip, from 0-9 with 0 being mapped to compressor none.
273 For zstd from 0-22, with levels from 20 to 22 enabling its ultra mode.
274 Before dpkg 1.16.2 level 0 was equivalent to compressor none for all
277 =item B<-S>I<compress-strategy>
279 Specify which compression strategy to use on the compressor backend, when
280 building a package (since dpkg 1.16.2).
281 Allowed values are B<none> (since
282 dpkg 1.16.4), B<filtered>, B<huffman>, B<rle> and B<fixed> for
283 gzip (since dpkg 1.17.0) and B<extreme> for xz.
285 =item B<-Z>I<compress-type>
287 Specify which compression type to use when building a package.
288 Allowed values are B<gzip>, B<xz> (since dpkg 1.15.6),
289 B<zstd> (since dpkg 1.21.18)
290 and B<none> (default is B<%DEB_DEFAULT_COMPRESSOR%>).
292 =item B<--[no-]uniform-compression>
294 Specify that the same compression parameters should be used for all archive
295 members (i.e. B<control.tar> and B<data.tar>; since dpkg 1.17.6).
297 B<data.tar> member will use those parameters.
299 compression types allowed to be uniformly used are B<none>, B<gzip>,
301 The B<--no-uniform-compression> option disables uniform compression
303 Uniform compression is the default (since dpkg 1.19.0).
305 =item B<--threads-max=>I<threads>
307 Sets the maximum number of threads allowed for compressors that support
308 multi-threaded operations (since dpkg 1.21.9).
310 =item B<--root-owner-group>
312 Set the owner and group for each entry in the filesystem tree data to
313 root with id 0 (since dpkg 1.19.0).
315 B<Note>: This option can be useful for rootless builds (see
316 I<rootless-builds.txt>), but should B<not> be used when the
317 entries have an owner or group that is not root.
318 Support for these will be added later in the form of a meta manifest.
320 =item B<--deb-format=>I<format>
322 Set the archive format version used when building (since dpkg 1.17.0).
323 Allowed values are B<2.0> for the new format, and B<0.939000>
324 for the old one (default is B<2.0>).
326 The old archive format is less easily parsed by non-Debian tools and is
327 now obsolete; its only use is when building packages to be parsed by
328 versions of dpkg older than 0.93.76 (September 1995), which was released
334 B<dpkg-deb --build>'s
335 usual checks on the proposed contents of an archive.
337 any archive you want, no matter how broken, this way.
339 =item B<-v>, B<--verbose>
341 Enables verbose output (since dpkg 1.16.1).
342 This currently only affects B<--extract> making it behave like
345 =item B<-D>, B<--debug>
347 Enables debugging output.
348 This is not very interesting.
358 The requested action was successfully performed.
362 Fatal or unrecoverable error due to invalid command-line usage, or
363 interactions with the system, such as accesses to the database,
364 memory allocations, etc.
372 =item B<DPKG_DEB_THREADS_MAX>
374 Sets the maximum number of threads allowed for compressors that support
375 multi-threaded operations (since dpkg 1.21.9).
377 The B<--threads-max> option overrides this value.
379 =item B<DPKG_DEB_COMPRESSOR_TYPE>
381 Sets the compressor type to use (since dpkg 1.21.10).
383 The B<-Z> option overrides this value.
385 =item B<DPKG_DEB_COMPRESSOR_LEVEL>
387 Sets the compressor level to use (since dpkg 1.21.10).
389 The B<-z> option overrides this value.
393 Sets the color mode (since dpkg 1.18.5).
394 The currently accepted values are: B<auto> (default), B<always> and
399 If set, it will be used to decide whether to activate Native Language Support,
400 also known as internationalization (or i18n) support (since dpkg 1.22.7).
401 The accepted values are: B<0> and B<1> (default).
405 If set, B<dpkg-deb> will use it as the directory in which to create
406 temporary files and directories.
408 =item B<SOURCE_DATE_EPOCH>
410 If set, it will be used as the timestamp (as seconds since the epoch) in
411 the L<deb(5)>'s L<ar(5)> container and used to clamp the mtime in
412 the L<tar(5)> file entries.
420 Do not attempt to use just
425 proper to ensure that all the files are correctly placed and the
426 package's scripts run and its status and contents recorded.
430 Examining untrusted package archives or extracting them into staging
431 directories should be considered a security boundary, and any breakage
432 of that boundary stemming from these operations should be considered a
433 security vulnerability.
434 But handling untrusted package archives should not be done lightly,
435 as the surface area includes any compression library supported,
436 in addition to the archive formats and control files themselves.
437 Performing these operations over untrusted data as root is strongly
440 Building package archives should only be performed over trusted data.
447 does the wrong thing.
449 There is no authentication on
451 files; in fact, there isn't even a straightforward checksum.
452 (Higher level tools like APT support authenticating B<.deb> packages
453 retrieved from a given repository, and most packages nowadays provide an
454 md5sum control file generated by debian/rules.
455 Though this is not directly
456 supported by the lower level tools.)
460 F<%PKGDOCDIR%/spec/rootless-builds.txt>,