dpkg-deb(1)
okay so bestie, this is dpkg-deb(1) from the dpkg suite โ the manual page for the Debian package archive (.deb) manipulation tool, and weโre gonna make it make sense ๐
โจ
๐ NAME ๐
dpkg-deb โ Debian package archive (.deb) manipulation tool ๐ฆ
โจ SYNOPSIS โจ
dpkg-deb [option...] command
๐ DESCRIPTION ๐
dpkg-deb packs, unpacks and provides information about Debian archives. Thatโs the whole vibe.
Use dpkg to install and remove packages from your system, bestie โ dpkg-deb is not the installer, okay? ๐ฅ
You can also invoke dpkg-deb by calling dpkg with whatever options you want to pass to dpkg-deb. dpkg will spot that you wanted dpkg-deb and run it for you. Love that for us ๐ซถ
For most commands taking an input archive argument, the archive can be read from standard input if the archive name is given as a single minus character (-); otherwise lack of support will be documented in their respective command description. Yes, - means stdin sometimes โ iconic but not universal ๐
๐ COMMANDS ๐
-b,--buildbinary-directory [archive|directory] โ creates a debian archive from the filesystem tree stored in binary-directory.binary-directorymust have aDEBIANsubdirectory, which contains the package metadata files such as the binary package control file. This directory will not appear in the binary packageโs filesystem archive, but instead the files in it will be put in the binary packageโs control information area.
Unless you specify --no-check, dpkg-deb will read DEBIAN/control and parse it. It will check the file for syntax errors and other problems, and display the name of the binary package being built. dpkg-deb will also check the permissions of the maintainer scripts and other files found in the DEBIAN package metadata directory.
If no archive is specified then dpkg-deb will write the package into the file binary-directory.deb.
If the archive to be created already exists it will be overwritten. (yes, zero hesitation ๐)
If the second argument is a directory then dpkg-deb will write to the file directory/package_version_arch.deb. When a target directory is specified, rather than a file, the --no-check option may not be used (since dpkg-deb needs to read and parse the package control file to determine which filename to use).
-I,--infoarchive [control-file-name...] โ provides information about a binary package archive.
If no control-file-names are specified then it will print a summary of the contents of the package as well as its control file.
If any control-file-names are specified then dpkg-deb will print them in the order they were specified; if any of the components werenโt present it will print an error message to stderr about each one and exit with status 2.
-W,--showarchive โ provides information about a binary package archive in the format specified by the--showformatargument. The default format displays the packageโs name and version on one line, separated by a tabulator.-f,--fieldarchive [control-field-name...] โ extracts control file information from a binary package archive.
If no control-field-names are specified then it will print the whole control file.
If any are specified then dpkg-deb will print their contents, in the order in which they appear in the control file. If more than one control-field-name is specified then dpkg-deb will precede each with its field name (and a colon and space).
No errors are reported for fields requested but not found. Ghosted fields donโt get a complaint ๐
-c,--contentsarchive โ lists the contents of the filesystem tree archive portion of the package archive. It is currently produced in the format generated bytarโs verbose listing.-x,--extractarchive directory โ extracts the filesystem tree from a package archive into the specified directory.
Note: extracting a package to the root directory will not result in a correct installation! Use dpkg to install packages.
directory (but not its parents) will be created if necessary, and its permissions modified to match the contents of the package.
-X,--vextractarchive directory โ is like--extract(-x) with--verbose(-v) which prints a listing of the files extracted as it goes.-R,--raw-extractarchive directory โ extracts the filesystem tree from a package archive into a specified directory, and the package metadata files into aDEBIANsubdirectory of the specified directory.
The target directory (but not its parents) will be created if necessary.
The input archive is not processed sequentially, so reading it from standard input (-) is not supported. So no sneaky stdin for this one ๐ค
Supported since dpkg 1.16.1.
--ctrl-tarfilearchive โ extracts the control data from a binary package and sends it to standard output in tar format. Together withtar(1)this can be used to extract a particular control file from a package archive.
The input archive might be processed non-sequentially if possible, and will fall back to be processed sequentially at the cost of fewer robustness or security checks.
Supported since dpkg 1.17.14.
--fsys-tarfilearchive โ extracts the filesystem tree data from a binary package and sends it to standard output in tar format. Together withtar(1)this can be used to extract a particular file from a package archive.
The input archive might be processed non-sequentially if possible, and will fall back to be processed sequentially at the cost of fewer robustness or security checks.
-e,--controlarchive [directory] โ extracts the package metadata files from a package archive into the specified directory.
If no directory is specified then a subdirectory DEBIAN in the current directory is used.
The target directory (but not its parents) will be created if necessary.
-?,--helpโ show the usage message and exit.--versionโ show the version and exit.
๐ธ OPTIONS ๐ธ
--showformat=formatโ this option is used to specify the format of the output--showwill produce. The format is a string that will be output for each package listed.
The string may reference any status field using the ${field-name} form, a list of the valid fields can be easily produced using -I on the same package. A complete explanation of the formatting options (including escape sequences and field tabbing) can be found in the explanation of the --showformat option in dpkg-query(1).
The default for this field is ${Package}\t${Version}\n. Yes, thatโs tab and newline coded in there, bestie โจ
-z,--compression-level=compress-levelโ specify which compression level to use on the compressor backend, when building a package (default is9for gzip,6for xz,3for zstd). The accepted values are compressor specific. For gzip, from0-9with0being mapped to compressor none. For xz from0-9. For zstd from0-22, with levels from20to22enabling its ultra mode. Before dpkg1.16.2level0was equivalent to compressor none for all compressors.
Support for long option since dpkg 1.22.9.
-S,--compression-strategy=compress-strategyโ specify which compression strategy to use on the compressor backend, when building a package. Allowed values arenone(since dpkg1.16.4),filtered,huffman,rleandfixedfor gzip (since dpkg1.17.0) andextremefor xz.
Support for short option since dpkg 1.16.2. Support for long option since dpkg 1.22.9.
-Z,--compression=compress-typeโ specify which compression type to use when building a package. Allowed values aregzip,xz(since dpkg1.15.6),zstd(since dpkg1.21.18) andnone(default isxz).
Support for long option since dpkg 1.22.9.
--uniform-compressionโ specify that the same compression parameters should be used for all archive members (i.e.control.taranddata.tar).
The only supported compression types allowed to be uniformly used are none, gzip, xz and zstd.
Uniform compression is the default (since dpkg 1.19.0).
Supported since dpkg 1.17.6.
--no-uniform-compressionโ specify that only thedata.tararchive member will use the compression parameters specified. Thecontrol.tararchive member will use gzip in its default compression parameters.
Supported since dpkg 1.19.0.
--threads-max=threadsโ sets the maximum number of threads allowed for compressors that support multi-threaded operations.
Supported since dpkg 1.21.9.
--root-owner-groupโ set the owner and group for each entry in the filesystem tree data to root with id0.
Note: this option can be useful for rootless builds (see rootless-builds.txt), but should not be used when the entries have an owner or group that is not root. Support for these will be added later in the form of a meta manifest.
Supported since dpkg 1.19.0.
--deb-format=formatโ set the archive format version used when building. Allowed values are2.0for the new format, and0.939000for the old one (default is2.0).
The old archive format is less easily parsed by non-Debian tools and is now obsolete; its only use is when building packages to be parsed by versions of dpkg older than 0.93.76 (September 1995), which was released as i386 a.out only.
Supported since dpkg 1.17.0.
--no-checkโ inhibitsdpkg-deb --buildโs usual checks on the proposed contents of an archive. You can build any archive you want, no matter how broken, this way.
Supported since dpkg 1.22.12.
--nocheckโ this is an alias for--no-check.-v,--verboseโ enables verbose output. This currently only affects--extractmaking it behave like--vextract.
Supported since dpkg 1.16.1.
-D,--debugโ enables debugging output. This is not very interesting. ngl the manual page said it, not me ๐
๐ฆ EXIT STATUS ๐ฆ
0โ the requested action was successfully performed. Slay โ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. Oof ๐ญ
๐ธ ENVIRONMENT ๐ธ
okay so these are the env vars that vibe with dpkg-deb, and yeah, each one is a whole personality ๐
DPKG_DEB_THREADS_MAXโ sets the max number of threads allowed for compressors that support multi-threaded operations. the--threads-maxoption overrides this value, so like, the flag wins, periodt. supported since dpkg 1.21.9.DPKG_DEB_COMPRESSOR_TYPEโ sets the compressor type to use. the-Zoption overrides this value. supported since dpkg 1.21.10.DPKG_DEB_COMPRESSOR_LEVELโ sets the compressor level to use. the-zoption overrides this value. supported since dpkg 1.21.10.DPKG_COLORSโ sets the color mode โจ the currently accepted values are:auto(default),alwaysandnever. supported since dpkg 1.18.5.DPKG_NLSโ if set, it's used to decide whether to activate Native Language Support, also known as internationalization (or i18n) support. the accepted values are:0and1(default). supported since dpkg 1.22.7.DPKG_PATH_PASSWDโ sets the pathname for the system passwd file. this path is relative to the--rootdirectory. the default is/etc/passwd. supported since dpkg 1.22.16.DPKG_PATH_GROUPโ sets the pathname for the system group file. this path is relative to the--rootdirectory. the default is/etc/group. supported since dpkg 1.22.16.TMPDIRโ if set,dpkg-debwill use it as the directory in which to create temporary files and directories. your temp zone, your rules ๐ซถSOURCE_DATE_EPOCHโ if set, it's used as the timestamp (as seconds since the epoch) in thedeb(5)'sar(5)container, and also used to clamp the mtime in thetar(5)file entries. supported since dpkg 1.18.8.
๐ NOTES ๐
do not attempt to use justdpkg-debto install software! ๐ญ like, i'm begging you. you must usedpkgproper to ensure that all the files are correctly placed and the package's scripts run and its status and contents recorded.
no shortcuts bestie, the real dpkg is the main character here ๐
๐ฅ SECURITY ๐ฅ
okay this part is serious, so listen up ๐ซถ
examining untrusted package archives, or extracting them into staging directories, should be considered a security boundary โ and any breakage of that boundary stemming from these operations should be considered a security vulnerability. so, yes, it's giving "real consequences" energy.
but handling untrusted package archives should not be done lightly, because the surface area includes any compression library supported, in addition to the archive formats and control files themselves. that's a lot of surface, ngl.
performing these operations over untrusted data as root is strongly discouraged. like, don't. just don't ๐
and building package archives should only be performed over trusted data. no cap.
๐ BUGS ๐
dpkg-deb -I package1.deb package2.debdoes the wrong thing. yeah. it just does ๐- there is no authentication on
.debfiles; there isn't even a straightforward checksum. (higher level tools like APT support authenticating.debpackages retrieved from a given repository, and most packages nowadays provide anmd5sumcontrol file generated bydebian/rules. though this is not directly supported by the lower level tools.)
so likeโฆ the low-level tools are out here raw-dogging it, checksum-wise. iykyk ๐ญ
๐ฆ SEE ALSO ๐ฆ
/usr/share/doc/dpkg/spec/rootless-builds.txtdeb(5)deb-control(5)dpkg(1)dselect(1)
and that's the whole page bestie! go forth and archive responsibly ๐๐
this was dpkg-deb(1) from the 1.23.11-dirty source, dated 2026-09-09 โ screenshot it, cite it, stan it โจ๐
๐ฆ where this page comes from
- arch rolling: dpkg 1.23.11-1 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms