Practical control of .deb packages with the low-level Debian installer tool. 08.03.2026 | reading time: 3 min Want direct control over .deb files and low-level package actions? "dpkg" is the Debian package manager that installs, queries and removes individual packages; this short guide shows how to act when apt cannot be used and how to recover from dependency trouble. Install and recover: a concrete scenario Try this: you have a local package and want to install it; run the command and observe the outcome, then fix broken dependencies and finish the installation as shown below. ```bash $ sudo dpkg -i foobar_1.2.3_amd64.deb Selecting previously unselected package foobar. (Reading database ... 123456 files and directories currently installed.) Preparing to unpack foobar_1.2.3_amd64.deb ... Unpacking foobar (1.2.3) ... dpkg: dependency problems prevent configuration of foobar: foobar depends on libxyz (>= 1.0); however: Package libxyz is not installed. Processing triggers for man-db (2.8.5) ... Errors were encountered while processing: foobar ``` If dependencies fail, let APT fetch what is missing and finish configuration, then re-run dpkg or let APT configure the package: ```bash $ sudo apt-get -f install $ sudo dpkg --configure -a ``` Inspect, list, and remove with precision Do not guess what a package did; inspect and act. Use `dpkg -l packagename` to see installation status, `dpkg -s packagename` for detailed status, `dpkg -L packagename` to list installed files, and `dpkg -S /path/to/file` to find the owning package; remove a package but keep configs with `dpkg -r packagename` or purge everything with `dpkg --purge packagename`. Advanced switches and package file tricks Handle architecture and unpack steps explicitly: `dpkg -i` installs, `dpkg-deb -c package.deb` lists its contents, `dpkg-deb -I package.deb` shows metadata, and `dpkg --configure package` finishes configuration for unpacked packages; use `dpkg --add-architecture` if you need multiarch support on a system. When dpkg sits inside a larger toolbox Remember: dpkg is a low-level tool; it will not fetch dependencies from repositories. Combine it with APT for dependency resolution, and use `apt-get -f install` or `apt install ./package.deb` to streamline the process; for scripted or bulk operations, dpkg-query and dpkg-deb are often used together. Parting thought Mastering dpkg gives direct, reliable control over Debian packages and is essential for recovery and manual deployment; keep practicing and integrate dpkg with higher-level tools to be efficient and confident on Debian-based systems. Join Bits & Bytes Academy First class LINUX exam preparation. utilities setup infrastructure troubleshooting