dpkg-deb(1)
Unpacks, examines, and manipulates Debian package archives (.deb files).
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
| Flag | What it does |
|---|---|
-x, --extract | Extract package contents to a directory |
-X, --vextract | Extract with verbose output listing each file |
-e, --control | Extract control information to a directory |
-W, --show | Display package metadata (name, version, size, etc.) |
-f, --field | Show specific control fields (Version, Depends, etc.) |
-c, --contents | List files contained in the package |
-b, --build | Build a .deb package from a directory tree |
-I, --info | Display package information and control file |
-R, --raw-extract | Extract to stdout (data.tar.* only) |
--fsys-tarfile | Output filesystem tarball to stdout |
-v, --verbose | Enable verbose output for build operations |
--nocheck | Skip 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.debShow only the Version field of a package
dpkg-deb -f package.deb VersionList all files contained in the package with permissions and sizes
dpkg-deb -c package.debDisplay the control file from a package
dpkg-deb -I package.deb controlBuild a .deb package from a directory containing DEBIAN/ subdirectory
dpkg-deb -b debian-dir/ mypackage.debExtract full package and control info separately for inspection
dpkg-deb -x package.deb . && dpkg-deb -e package.deb DEBIAN