Show info:
dpkg --info $package
Show all files of a deb:
dpkg -L $package
Show all installed packages:
dpkg -l
Search for a file or path:
dpkg -S htpasswd
Show why a package was installed:
apitude why apache2-utils
About deb files
A deb file is a ar archive with this structure:
$ ar t example.deb
debian-binary
control.tar.xz (or .gz or .zst)
data.tar.xz (or .gz or .zst)
- debian-binary is a text file with the version, currently “2.0”
- control.tar.xz contains metadata and scripts.
- data.tar.xz contains the files to be installed/copied.
There are these package formats:
- Real package
- Metapackage is a package without own content which only references other packages.
- Virtual package is just an additional name for another package (basically a link)
Using other architectures
dpkg --print-architecture
dpkg --add-architecture i386
Getting / Rebuilding (debian-based) packages
Get source of a package:
apt source $name
To get all needed build tools, into the source code directory from the package:
apt build-dep ./
Change the version number
dch --local version-identifier
Perform the changes.
Then, build the package.
dpkg-buildpackage -us -uc -b
And install it.
dpkg -i $name.deb
Leave a Reply
You must be logged in to post a comment.