$linuxjunkies
>

dpkg-deb(1)

Unpacks, examines, and manipulates Debian package archives (.deb files).

UbuntuDebianFedoraArch

Synopsis

dpkg-deb [OPTION]... COMMAND [ARGS]

Description

dpkg-deb is the low-level tool for working with Debian binary packages. It can extract contents, view package metadata, build packages from scratch, and inspect package structure without actually installing them.

Common operations include extracting files, reading control information, printing package contents, and creating new .deb archives from a directory tree.

Common options

FlagWhat it does
-x, --extractExtract package contents to a directory
-X, --vextractExtract with verbose output listing each file
-e, --controlExtract control information to a directory
-W, --showDisplay package metadata (name, version, size, etc.)
-f, --fieldShow specific control fields (Version, Depends, etc.)
-c, --contentsList files contained in the package
-b, --buildBuild a .deb package from a directory tree
-I, --infoDisplay package information and control file
-R, --raw-extractExtract to stdout (data.tar.* only)
--fsys-tarfileOutput filesystem tarball to stdout
-v, --verboseEnable verbose output for build operations
--nocheckSkip validity checks during build

Examples

Extract all files from a .deb package into the ./extracted/ directory

dpkg-deb -x package.deb ./extracted/

Extract just the control metadata (DEBIAN directory) to control/

dpkg-deb -e package.deb control/

Display basic package info (name, version, architecture, size)

dpkg-deb -W package.deb

Show only the Version field of a package

dpkg-deb -f package.deb Version

List all files contained in the package with permissions and sizes

dpkg-deb -c package.deb

Display the control file from a package

dpkg-deb -I package.deb control

Build a .deb package from a directory containing DEBIAN/ subdirectory

dpkg-deb -b debian-dir/ mypackage.deb

Extract full package and control info separately for inspection

dpkg-deb -x package.deb . && dpkg-deb -e package.deb DEBIAN

Related commands