Generated by GPT-5-mini| dpkg | |
|---|---|
| Name | dpkg |
| Developer | Ian Murdock; Debian Project |
| Released | 1994 |
| Programming language | C (programming language) |
| Operating system | Debian (operating system), Ubuntu (operating system), Linux (kernel) |
| Genre | package manager |
| License | GNU General Public License |
dpkg dpkg is the low-level package manager originally created for the Debian Project and used by derivatives such as Ubuntu (operating system), Kali Linux, Raspbian and other Linux distributions. It provides the core facilities to install, remove, query and manage Debian (operating system) binary packages (.deb) and maintains a local package database on systems running the Linux (kernel). dpkg operates beneath higher-level tools such as APT (software), Synaptic (software), aptitude and integrates with system components like systemd and dpkg-trigger.
dpkg is a command-line program for unpacking, configuring and querying Debian (operating system) packages. It manipulates the .deb archive format, handles control scripts and metadata, and records file lists and configuration status in a local database. The utility is complementary to APT (software) which resolves dependencies using remote repositories like Debian repositories, Ubuntu Launchpad, or OpenSUSE Build Service mirrors. Common higher-level frontends include Synaptic (software), Software Center (Ubuntu), Gdebi, and aptitude.
Development of dpkg began in the early 1990s under Ian Murdock as part of the founding of the Debian Project in 1993. The .deb package format and dpkg utilities were formalized alongside Debian’s release engineering practices used across releases such as Debian 0.93, Debian 1.1 "Buzz", Debian 2.0 "Hamm", and later stable and testing branches. Over time, contributions from individuals and organizations like Canonical (company), Collabora, and various Debian maintainers extended dpkg to support maintainer scripts, triggers, and status database improvements aligned with evolving init systems including SysVinit and systemd.
dpkg’s architecture centers on a set of executable tools and data files. Core binaries include the user-facing dpkg-query and dpkg-deb, internal modules and libraries written in C (programming language), and helper scripts for maintainer actions. The local package database resides in /var/lib/dpkg and includes key files such as status, available, and info directories that describe installed packages and file lists. Control script hooks (preinst, postinst, prerm, postrm) allow integration with services like systemd, udev, and udev (software). The .deb archive itself follows the Unix ar format and contains data.tar.gz or data.tar.xz and control.tar.gz with metadata fields compatible with Debian Policy and standards maintained by the Debian Developers.
Common dpkg operations are performed with subcommands: installing an individual package via -i, removing with -r, purging with -P, and querying with -l or -L. Administrators use dpkg-query to list package status, dpkg-deb to inspect or build .deb archives, and dpkg --configure to resume interrupted configuration steps. Options interact with system facilities such as triggers and conffile handling policies defined by Debian Policy Manual and invoked during upgrades like those performed for distributions including Ubuntu 20.04 LTS or Debian 11 "Bullseye". Advanced usage involves scripting with shell tools like bash and automation platforms such as Ansible (software), Puppet (software), or Chef (software).
The .deb package is an ar archive containing control and data members; control metadata follows fields standardized by the Debian Policy and uses fields like Depends, Provides, and Conflicts. Compression formats supported for payloads include gzip, xz and bzip2 as adopted across Debian releases. The dpkg status database records each package’s selection state and conffile modifications; files in /var/lib/dpkg/info include md5sums, list files, and maintainer scripts used by package lifecycles. Tools such as lintian and piuparts are commonly used to validate package policy and integrity during package build and QA workflows.
dpkg functions as the backend for APT (software), which handles dependency resolution, repository metadata from sources like Debian repositories and Personal Package Archives hosted on Launchpad (website). Frontends including Synaptic (software), GNOME Software, and Software Center (Ubuntu) provide graphical access while calling dpkg/apt internals. The apt layer translates package selection operations into sequences of dpkg invocations while managing transaction safety, caching via /var/cache/apt/archives, and repository signing with tools like GnuPG. Integration also supports configuration management systems and CI pipelines used by projects like Debian Continuous Integration.
Contributions to dpkg are coordinated through the Debian Project’s infrastructure, mailing lists such as debian-devel, and version control systems historically hosted on Savannah (software hosting), then GitHub, and Dpkg’s git repository. Developers follow the Debian Policy and use packaging tools like dpkg-dev, debhelper, pbuilder, and sbuild to build and test packages. Quality assurance employs code review, automated testing with CI services, static analysis tools, and community-driven bug tracking via the Debian Bug Tracking System. Contributors range from individual Debian Developers to organizations that sponsor long-term maintenance and security updates across distributions like Ubuntu (operating system), Raspbian, and enterprise deployments.