Fact-checked by Grok 2 weeks ago

dpkg

dpkg is a low-level package manager for the Debian GNU/Linux operating system and its derivatives, such as Ubuntu, responsible for installing, building, removing, and querying software packages in the Debian binary package format (.deb). It serves as the foundational backend for higher-level tools like apt and aptitude, handling core operations such as package configuration and status tracking without automatically resolving dependencies from repositories. Developed initially by in 1993 as part of the early project, dpkg evolved from a primitive packaging tool lacking support into a robust system under the enhancements led by Ian Jackson in 1994, which introduced and features. By 1995, with the release of 0.93R5, dpkg became the standard for package management, supporting the system's growth across multiple architectures and enabling the distribution's philosophy through tools like dselect for user-friendly selection. Over time, its package format shifted to the widely compatible ar archive structure, and it has been maintained by the Dpkg team, currently led by Guillem Jover, with ongoing development hosted on . Key features of dpkg include commands for actions like --install to unpack and configure packages, --remove to delete them while preserving configuration files, and --purge for complete removal, along with query options such as --list to enumerate installed packages and --status to inspect details. It tracks package states (e.g., installed, half-configured, unpacked) and selection states (e.g., hold, ), providing options for force overrides, , and recursive processing of directories. While powerful for direct manipulation, dpkg's design emphasizes manual control, making it essential for system administrators but typically wrapped by front-ends for everyday use in Debian-based distributions.

Introduction

Definition and Purpose

dpkg is the foundational package management tool for Debian-based operating systems, including derivatives such as Ubuntu. It serves as a low-level utility specifically designed to install, remove, build, and query Debian packages in the .deb format directly on a local system. As of November 2025, the current version available in Debian's unstable branch (sid) is 1.22.21. The primary purpose of dpkg is to handle the granular management of software packages, checking for unmet dependencies and detecting conflicts between packages, preventing installation in such cases, and application of necessary changes to the filesystem. This includes unpacking package contents, configuring files, and maintaining a database of installed packages to track their states and relationships. By operating at this base level, dpkg provides the essential infrastructure for maintaining system integrity without relying on higher-level abstractions. Unlike repository-focused tools, dpkg works exclusively with local .deb files and does not interact with remote package archives or perform automatic downloads. It can be integrated with higher-level front-ends like APT, which extend its functionality to repository management, but dpkg itself remains focused on direct package operations.

Relationship to Higher-Level Tools

dpkg serves as the foundational backend for higher-level package management tools in -based systems, particularly the Advanced Package Tool (APT), which extends dpkg's capabilities by incorporating repository fetching, dependency resolution, and automated updates. APT relies on dpkg to perform the actual , removal, and of Debian packages (.deb files) after handling higher-level tasks such as downloading packages from repositories and resolving complex dependencies across the system. Various frontends build upon this integration to provide more user-friendly interfaces for package management. Tools like apt and aptitude act as command-line and text-based user interfaces (TUI) that abstract direct dpkg invocations, allowing users to perform operations such as searching, installing, and upgrading packages without manually managing dependencies or file downloads. Similarly, graphical frontends like Synaptic leverage APT and dpkg to offer visual package selection, repository configuration, and status overviews, simplifying tasks for non-technical users. A typical workflow illustrates this layering: when a user runs apt install package-name, APT first updates its package lists from configured repositories if needed, resolves and downloads all required dependencies, and then invokes dpkg to unpack and configure the packages on the system, ensuring file integrity and script execution. This architectural layering provides key benefits, as dpkg focuses on low-level operations like verifying package integrity, handling file conflicts, and executing maintainer scripts, while higher-level tools like APT manage broader ecosystem aspects such as secure repository sourcing, automatic security updates, and multi-package dependency graphs to maintain system consistency.

History

Origins and Early Development

dpkg was initially developed by Ian Murdock as a simple shell script in early 1993, coinciding with the release of Debian 0.91, the first version of the Debian distribution to incorporate a package management system. This tool emerged as part of Murdock's efforts to establish a structured Linux distribution following the founding of the Debian Project in August 1993, addressing the need for a reliable method to distribute and install software binaries in a Debian-specific format. The initial implementation of dpkg focused on basic operations such as unpacking and installing packages, laying the groundwork for Debian's packaging philosophy centered on free software accessibility and community-driven development. In mid-1994, Ian Jackson took over the development of dpkg, rewriting it first in to enhance functionality and then to improve performance and reliability. This rewrite introduced key features like dependency tracking and , transforming dpkg from a rudimentary into a more robust tool capable of managing complex software interactions. Jackson also restructured the codebase, renaming the core component to dpkg-deb and developing a unified front-end interface, which standardized package handling and adopted the ar archive format for better compatibility with systems. Early development of dpkg faced significant challenges, particularly in managing software dependencies without higher-level tools like APT, which would not emerge until later. The pre-APT era required manual resolution of inter-package relationships, making installations prone to errors and limiting scalability as Debian's developer base grew. Despite these hurdles, dpkg's debut in 0.93R5 in March 1995 marked a pivotal step, enabling the distribution to support an expanding of packages and solidifying its role as the foundational element of Debian's ecosystem.

Major Releases and Modern Updates

The development of dpkg has seen several milestone releases that introduced key enhancements to its functionality, beginning with version 1.0 in 1995, which established basic support for package dependencies, enabling more reliable and conflict resolution processes. This version laid the groundwork for dpkg's role in managing interdependent software components within distributions. Subsequent updates built on this foundation, with version 1.10 released in 2002 introducing initial multiarch hints to facilitate architecture-specific package handling and cross-compilation awareness. These hints allowed dpkg to better parse and support varying hardware architectures, anticipating fuller multiarch capabilities in later iterations. By 2013, dpkg 1.17 marked a significant advancement in scripting robustness, with improvements to maintainer script execution, including changes to the for scripts and new hooks for architecture management operations. This release enhanced the reliability of pre- and post-installation scripts, reducing errors in complex package transitions and supporting more dynamic system configurations. The 1.17 series also refined dependency parsing and control file handling, contributing to greater stability in Debian's package ecosystem. More recent developments in the 1.21 series, spanning to , focused on enhancements, addressing vulnerabilities such as directory traversal issues in dpkg-source and improper cleanup of temporary directories, which could lead to denial-of-service attacks. For instance, version 1.21.9 incorporated fixes for CVE-2022-1664 related to symlink attacks during . These updates strengthened dpkg's checks and mechanisms, ensuring safer handling of untrusted package data. As of July 2025, dpkg reached version 1.22.21, which included bug fixes for control member cleanup (addressing CVE-2025-6297) and support for testing migrations in 's unstable branch, alongside refinements to and build hooks. This release migrated to testing on July 9, 2025, emphasizing incremental stability improvements. The dpkg project is maintained by the dpkg team using for collaborative development, prioritizing and long-term support for stable distributions like 13 (Trixie). Ongoing efforts include integration with , where dpkg supports deterministic package creation by standardizing timestamps and file ordering in archives, aiding of across builds.

Core Features

Package Handling Capabilities

dpkg serves as the foundational tool for managing Debian packages, enabling the installation of .deb files by extracting their contents to the filesystem and configuring the software accordingly. It supports removal of installed packages, which deinstalls the software while preserving user-modified configuration files, and purging, which fully eliminates the package including all associated configuration data. Additionally, dpkg provides querying capabilities to inspect package status, contents, and availability without altering the system. In terms of dependency management, dpkg checks required dependencies and conflicts during package operations, refusing to proceed unless they are satisfied (unless overridden), ensuring that interdependent software is handled correctly to maintain system stability. It supports placing packages to prevent unintended upgrades or removals, and processes triggers that activate actions in other packages following installations or updates. For filesystem integration, dpkg manages configuration files (conffiles) by comparing versions during upgrades: unchanged files remain intact, user-modified ones are preserved unless the maintainer provides no updates, and conflicts prompt user intervention to avoid . It utilizes the alternatives system to handle multiple implementations of the same file, such as different editors for a generic command, by maintaining symbolic links based on priorities or manual selection to enable seamless switching without conflicts. Diversions allow dpkg to redirect specific files to alternative locations, preventing overwrites by local modifications or other packages, which is particularly useful for wrappers or overrides. Regarding security, dpkg verifies package integrity by comparing installed file contents against checksums stored in its database, detecting alterations post-installation but not providing cryptographic signing verification, which is managed by higher-level tools like APT through signed release files. This checksum-based approach ensures basic tamper detection during package handling.

Multi-Architecture and Localization Support

dpkg's multi-architecture support, introduced in version 1.16.2 in 2012, enables the co-installation of binary packages targeted at different hardware architectures on a single system without conflicts. This allows users to run software compiled for foreign architectures, such as installing (32-bit x86) libraries and binaries alongside native amd64 (64-bit x86) packages on an x86_64 host, facilitating compatibility for legacy applications and cross-architecture dependencies. Architecture qualifiers in dpkg extend this capability by permitting explicit specification of architectures in package names, dependencies, and provides fields within control files. The syntax appends a colon followed by the architecture triplet (e.g., "libc6:i386") to disambiguate packages across architectures, ensuring that dependency resolution accounts for foreign architectures during and upgrades. This mechanism is essential for managing multi-arch setups, where dpkg tracks installed packages per architecture in its database. dpkg also incorporates localization support through the internationalization framework, providing translated messages for command-line output and error reporting in numerous languages. The compiled message object (.mo) files are placed in /usr/share/ under language-specific subdirectories (e.g., /usr/share//fr/LC_MESSAGES/dpkg.mo for ), allowing users to select their preferred language via s like LANG or LC_MESSAGES. This NLS feature, controllable via the DPKG_NLS , ensures accessibility for non-English speakers in Debian-based systems. In contemporary Debian deployments as of 2025, multi-architecture support extends to emerging platforms like ARM64 (aarch64) and (riscv64), which are officially integrated into ports. Users can add these architectures with commands like dpkg --add-architecture arm64 or dpkg --add-architecture riscv64, enabling installation of cross-compiled packages for development, emulation, or hybrid environments on supported hosts.

Architecture and Internals

Database Structure

The dpkg database serves as the central repository for tracking the state and metadata of packages on a system, enabling consistent of software installations. It is located in the /var/lib/dpkg/ by default, which can be overridden using the --admindir option during dpkg operations. This houses critical files and subdirectories that store persistent information about packages, ensuring that dpkg can query and update package states without relying on external sources during routine tasks. The structure is designed for efficiency and reliability, with plain-text files that are human-readable yet machine-parsable, facilitating both manual inspection and automated scripting. Key components include the status file, which maintains records of installed and previously installed packages, including their current states such as "install ok installed" for fully operational packages, "config-files" for remnants of removed packages, or other transitional statuses like "half-installed" or "unpacked." The available file contains metadata for packages that dpkg knows about but may not have installed, derived from package lists provided during updates. Additionally, the info/ subdirectory holds per-package details, such as control files (e.g., package.list for installed files, package.md5sums for integrity checks, and package.postinst for scripts), allowing dpkg to manage individual package artifacts precisely. The status file follows the deb822 format, a stanza-based structure where each package entry is a self-contained paragraph separated by empty lines, comprising key-value fields in the style of RFC 822 headers. Essential fields include Package for the package name, Status to denote installation state and flags (e.g., "install ok installed"), and Depends to list runtime dependencies in a comma-separated format that may span multiple lines via folding. Other common fields encompass Version, Architecture, Maintainer, and Installed-Size, all encoded in UTF-8 with case-sensitive names and no duplicates per stanza. This format ensures extensibility and compatibility with tools like grep-dctrl for parsing. For example, a sample stanza might appear as:
Package: example-package
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 1024
Maintainer: Example Maintainer <[email protected]>
Architecture: amd64
Version: 1.0-1
Depends: libc6 (>= 2.14)
dpkg maintains the database integrity during operations by updating these files atomically—for instance, modifying status entries when configuring, removing, or purging packages, and merging new availability data via commands like --merge-avail. To prevent concurrent modifications that could lead to corruption, dpkg employs lock files within the administrative directory, notably /var/lib/dpkg/lock for backend operations and /var/lib/dpkg/lock-frontend for user-facing frontends, ensuring only one process accesses the database at a time. Daily backups of status and related files are stored in /var/backups/ to aid recovery from issues. Querying the database is facilitated by dpkg-query, a dedicated tool that extracts specific information from these files without altering them, making it invaluable for scripting package audits, dependency resolution, or status reporting. For instance, options like --list retrieve package lists with statuses, while --show displays detailed fields from status or available, supporting and output formatting for integration into larger administrative workflows. This querying capability underscores dpkg's role as a foundational layer for higher-level tools, providing raw access to the system's package state.

Configuration and Hooks

dpkg's configuration is primarily managed through the global file /etc/dpkg/dpkg.cfg, which specifies default options mirroring command-line flags to alter its behavior system-wide. Each line in this file contains a single option without leading hyphens, such as no-act to enable dry-run mode that simulates package operations without executing changes, or root to redirect installations to a non-standard root directory. Comments begin with #, and quoted values are stripped during parsing. Supplementary fragment files in /etc/dpkg/dpkg.cfg.d/ allow modular organization of options, processed alongside the main file since dpkg 1.15.4. User-specific overrides can be placed in ~/.dpkg.cfg. Environment variables offer runtime customization without modifying files. The DPKG_ROOT variable defines the filesystem for package installations, facilitating chroot-like isolated environments when the --root option is absent; it is also set in maintainer scripts and defaults to empty for standard system-wide operations. Similarly, DPKG_ADMINDIR relocates the administrative database directory, overriding the default /var/lib/dpkg (or /usr/local/var/lib/dpkg in some builds) if not specified via --admindir or --root, enabling scenarios like multi-system management. dpkg extends its functionality through invoke hooks, which execute external scripts before or after core actions such as unpacking, configuring, or removing packages. These hooks, introduced in dpkg 1.15.4, are invoked via using options like --pre-invoke or --post-invoke, with the environment variable set to the current action (e.g., "unpack" or "configure") for contextual awareness; they are skipped in dry-run mode. Triggers provide a deferred mechanism for inter-package interactions, recording events like file installations from one package that affect others, then aggregating and processing them efficiently to minimize redundant work. Supported since dpkg 1.14.17, triggers are declared in package control files and stored in /var/lib/dpkg/triggers/, with pending activations listed in /var/lib/dpkg/triggers/Deferred for batch execution via the --triggers-only action. The dpkg-trigger utility explicitly activates or queries triggers, supporting complex maintainer scripts. A representative involves updating shared resources, such as menu databases when icon files are installed across multiple packages, as implemented in tools like update-desktop-database since version 0.21-1.

Usage and Operations

Command-Line Basics

dpkg operates through a with the fundamental syntax dpkg [options] action ..., where options modify behavior, actions specify operations such as installation or removal, and additional arguments like package names or files follow as needed. Common options include flags for forcing actions, such as --force-depends, which allows proceeding despite unmet dependencies, though this is generally discouraged to avoid system instability. For package installation, the command dpkg -i <package.deb> unpacks and configures a specified .deb file, performing checks on Pre-Depends and Depends fields before setup; if dependencies are unmet, dpkg halts and reports the issue. Removal is handled by dpkg -r <package-name>, which deconfigures and removes the package files while preserving files (conffiles) unless overridden. These operations output status messages like "Unpacking ..." or "Setting up ..." to indicate progress. Querying package information uses commands like dpkg -l to list all installed packages with their (such as "" for installed), or dpkg -s <package-name> to display detailed including and for a specific package. For handling, dpkg commonly outputs warnings for unmet , such as "package depends on unmet-package; however: Package unmet-package is not installed," prompting users to resolve by installing missing packages or using higher-level tools like APT, which automates across repositories.

Advanced Management Tasks

dpkg-reconfigure is a utility that allows administrators to re-run the for an already installed package, prompting for settings such as timezone adjustments in the tzdata package. This command invokes the package's post-installation scripts to solicit user input via debconf, enabling changes to behavioral parameters without reinstallation. For instance, executing dpkg-reconfigure tzdata will query for geographic region and city selections to update system time zones. Package holds and selections provide mechanisms to control installation states across multiple packages. The dpkg --set-selections command reads package names and desired states (such as install, hold, remove, or ) from input, allowing ; for example, echo "package-name hold" | dpkg --set-selections prevents automatic upgrades for the specified package unless overridden with --force-hold. A hold state specifically inhibits upgrades or removals, useful for stabilizing critical software during testing phases. These operations require an up-to-date package list from sources like apt. Diversions and alternatives address file conflicts and multiple implementations in shared paths. The dpkg-divert tool redirects a package's file to an alternative , avoiding overwrites; for example, dpkg-divert --divert /usr/bin/editor.old --rename /usr/bin/editor moves the original editor while allowing another package to install its version. This is particularly useful for resolving conflicts between packages providing the same file. Complementing this, update-alternatives manages symbolic links for multi-provider tools, such as text editors, by maintaining a priority-based selection system; running update-alternatives --install /usr/bin/editor editor /usr/bin/vim 100 registers Vim as an with high priority, enabling seamless switching via update-alternatives --config editor. Recovery operations in dpkg facilitate broken installations. The dpkg --audit command scans the package database for inconsistencies, such as partially installed packages or missing files, reporting issues since dpkg 1.17.10. To address pending configurations, dpkg --configure -a processes all unpacked but unconfigured packages, often invoked after interrupted upgrades. In scenarios involving partial upgrades, where mismatches occur, these tools help restore integrity by identifying and resolving stalled actions; recent dpkg s, such as 1.22.21 released in July 2025, include stability fixes for trigger handling in recovery modes to prevent segfaults during no-act s.

Development Tools

Building Packages

Building Debian packages, also known as .deb packages, involves using tools from the dpkg suite to create distributable archives from source code, primarily for the ecosystem and derivatives like . The process is designed for developers to package software while ensuring compatibility, dependency resolution, and metadata integrity. Central to this is the dpkg-dev package, which provides essential utilities such as dpkg-buildpackage and dpkg-source for automating the workflow. The overall build process begins with unpacking the source code, applying patches if needed, compiling the software according to rules defined in the debian/rules file, and generating and packages. This is orchestrated by dpkg-buildpackage, which, when invoked in the source directory (e.g., dpkg-buildpackage -us -uc to skip signing), performs a sequence of steps: it cleans the source tree using debian/rules clean, builds the source package with dpkg-source -b, compiles the program via debian/rules build, creates packages under fakeroot using debian/rules binary, and generates descriptor files like .dsc and .changes. The resulting .deb files contain the compiled binaries, documentation, and control information for installation via dpkg. For source-only uploads, which have been required for normal Debian archive submissions since July 2019 to leverage the buildd network for architecture-specific binaries, developers use dpkg-buildpackage -S to produce only the source artifacts without binaries. Debian source packages support multiple formats managed by dpkg-source, which handles extraction, packing, and patch application. The 1.0 format is the simplest and oldest, treating the package as a single tarball with optional patches stored in debian/patches, unpacked via dpkg-source -x on the .dsc file alongside .orig.tar.gz and .diff.gz. In contrast, the 3.0 (quilt) format, introduced in dpkg 1.14.17 and now the de facto standard for non-native packages, uses Quilt for structured patch management, storing changes in debian/patches and supporting multiple upstream tarballs; extraction requires the .dsc, .orig.tar.* (for original source), and .debian.tar.* (for Debian-specific additions), with options like --skip-patches to bypass application. The 3.0 (native) variant extends this for packages originating in Debian, without separate upstream sources. dpkg-source ensures reproducible extraction by preserving file permissions and timestamps where possible. Key metadata for packages is defined in the debian/control file, which dpkg tools parse during builds to generate package headers. Essential fields include (e.g., 1.2.3-1, combining upstream and Debian revisions), (specifying targets like any, all, or amd64 for multi-architecture support), and Depends (listing runtime prerequisites like libc6 (>= 2.28) to ensure proper installation ordering). Additional build-related fields such as Build-Depends (for compilation dependencies) and Standards-Version (indicating policy compliance) are also critical, influencing how dpkg-buildpackage resolves environments. These fields enable dpkg to validate and integrate packages into the system database. To facilitate verifiable and identical builds across environments, dpkg incorporates support through flags and environment variables. Since dpkg 1.18.19, integration with build profiles allows setting SOURCE_DATE_EPOCH to normalize timestamps in archives, while dpkg-buildflags retrieves compiler options like -O2 or hardening flags from /etc/dpkg/buildflags.mk for consistent outputs. Since dpkg 1.21.0, dpkg-buildpackage supports the --buildinfo-file option to specify the filename for embedding metadata in .buildinfo files, aiding in 's testing migration and policy enforcement for reproducible packages. As of November 2025, dpkg 1.22.21 remains the latest stable version, included in Debian 13.2.

Source and Control File Tools

dpkg-source is a utility within the dpkg-dev package that handles the packing and unpacking of source archives, primarily through .dsc files and associated tarballs. It supports commands such as --extract, which unpacks a source package from a .dsc file into a specified directory, reading tarball names from the .dsc and applying appropriate permissions (0777 for directories and executables, 0666 for files, adjusted by ). The --build command constructs a source package from a directory containing a debian subdirectory, utilizing formats specified in debian/source/format or defaulting to "1.0" (now deprecated in favor of newer formats like 3.0 ). These operations facilitate the management of source tarballs, such as .orig.tar.gz for upstream code and .debian.tar. for Debian-specific changes, ensuring compatibility with compression methods like or ( as default for formats 2.0 and later). dpkg-gencontrol generates control files for binary packages from the debian/control template in an unpacked source tree. It processes the source file, applies substitutions from debian/substvars (or multiple files since dpkg 1.15.6), and simplifies dependency relations by removing redundancies, such as self-dependencies in Depends fields. The tool outputs to debian/tmp/DEBIAN/ by default but supports stdout with -O (since dpkg 1.17.2) and options like -p for specifying the binary package, -V for adding variables, and -P for scanning alternate build directories to compute Installed-Size accurately. This ensures that the resulting .deb files include precise , such as unions of Conflicts or Provides across packages. dpkg-genbuildinfo creates .buildinfo files that record build environment details, aiding in and . Introduced in dpkg 1.18.11, it reads from debian/control, debian/changelog, and debian/files, incorporating build dependencies, file checksums, and sizes for artifacts like binaries and sources. Key options include --build to specify types (e.g., any, all, full), -O for stdout output, and --always-include-path for retaining full paths in logs, with environment variables like DEB_BUILD_OPTIONS influencing the process. These files, named like source-version_arch.buildinfo, provide a standardized record for verifying builds post-construction. dpkg-distaddfile adds entries to debian/files, enabling the inclusion of additional files in source package uploads. It requires three arguments: the filename (relative to the parent directory), section, and priority, appending them to the file list used by tools like dpkg-genchanges. The -f option allows specifying an alternate files list, supporting custom workflows during package preparation. dpkg-genchanges generates .changes files summarizing upload contents from built source trees, incorporating control data and file lists. It supports build-type options like -b for binaries or -s for sources (since dpkg 1.18.5) and applies substitutions from debian/substvars, including on Description fields since dpkg 1.19.0. In version 1.22.21 (released July 2025),

User Frontends

dselect serves as the traditional text-based frontend to dpkg, providing a full-screen, menu-driven interface for selecting, installing, removing, and managing Debian packages. It operates by allowing users to navigate through a series of steps, including updating the package list, selecting packages via a categorized view, installing chosen packages, configuring them, and removing obsolete ones. This frontend relies on various access methods to retrieve package information and files, such as multi-CD sets or mounted filesystems, making it particularly suited for environments without direct internet access. Historically, dselect was the default user interface for package management in early releases, offering a straightforward way to handle dependencies and conflicts interactively before the advent of more advanced tools. Although it remains functional and available in 12 (Bookworm) and later, it is no longer installed by default, having been deprecated in favor of APT-based frontends like since around 2005. It continues to be useful for offline installations, where users can prepare Packages files in advance from sources like CD-ROMs or local mirrors. One key limitation of dselect is its lack of built-in support for online repositories; it depends on pre-downloaded or locally available Packages files rather than dynamically fetching from remote sources, unlike modern APT frontends which integrate seamless . While dselect can now optionally use APT as an access method for installations, its core design emphasizes manual selection and does not provide advanced features like automatic resolution from multiple sources or pinning. This makes it less suitable for routine online updates but preserves its role in controlled, offline scenarios.

Auxiliary Tools

dpkg distributes several auxiliary utilities that support package management tasks, particularly in maintaining system configurations and handling processes during installation and removal. These tools are invoked primarily through package maintainer scripts rather than direct user interaction, ensuring consistent behavior across Debian-based systems. The update-alternatives utility manages symbolic links for alternative implementations of system commands or files, allowing multiple versions of a to coexist while providing a single default entry point. For instance, it can configure /usr/bin/editor to point to different text editors like nano or vim via a master-slave link group, where the master link (e.g., the ) and slave links (e.g., man pages) are updated together. Packages register their alternatives during installation using the --install option in their postinst script and deregister with --remove in the prerm script, enabling administrators to select defaults interactively via --config or automatically with --auto. This mechanism, part of the dpkg suite since its early development, integrates with Debian's policy for handling interchangeable software components without file conflicts. start-stop-daemon provides a standardized way to start, stop, or query system daemon processes, scanning the process table for matches based on criteria such as , executable name, or user ownership. It is essential for package scripts to control services reliably, preventing duplicate starts with the --start option (which checks for existing instances) and sending signals like for graceful shutdowns via --stop. Options like --pidfile and --retry enhance robustness, allowing retries on failure or specific signal sequences. As a component of dpkg, it is commonly embedded in scripts called during package to manage long-running processes without relying on external tools like killall. Originally, dpkg included install-info for updating the Info directory index (dir) with entries from documentation files during package operations. However, to better support advanced features like multi-section documents, this tool was transitioned to the separate install-info (from the texinfo package) starting in 2009, with dpkg's version removed in favor of a wrapper script. By dpkg version 1.15.8 in 2013, direct inclusion ceased, and modern systems (as of 2025) largely handle Info file registration via package triggers and the update-info-dir utility, rendering manual install-info calls obsolete in most scenarios. These tools may also be referenced in dpkg hooks for custom pre- or post-installation logic.

Variants and Ports

Windows Port (wpkg)

wpkg is an open-source software package manager designed as a port of the Debian dpkg tool for Microsoft Windows systems, enabling the management of Debian-compatible (.deb) packages on non-Unix platforms. Developed by Made to Order Software Corporation, it was first released in late 2006 and allows users to create, install, upgrade, and remove packages in a manner closely mimicking dpkg's functionality, while addressing Windows-specific constraints such as file paths and system integration. The tool supports cross-compilation and runs on Windows, Linux, macOS, and other Unix-like systems, facilitating package handling in heterogeneous environments. Key features of wpkg include dependency resolution during installation, which checks and automatically handles required packages similar to dpkg's behavior, and comprehensive uninstallation options via commands like --remove and --purge that deconfigure and clean up installed files. Adaptations for Windows encompass support for file paths, including long path handling, and integration with the for storing package metadata and configuration details, ensuring seamless operation without relying on Unix-specific tools. Additionally, wpkg maintains full compatibility with the binary package format (.deb), allowing it to process and generate packages that are interchangeable with those from dpkg, including control files and scripts. Development of wpkg reached its last major release, version 1.0.0, on August 28, 2015, following a series of updates in 2013 and 2014 that improved C++ support and removed dependencies like . Since then, activity has been limited, with no significant releases or updates reported, though the tool remains functional for packages from the era around dpkg version 1.18. This stagnation reflects a shift in focus by the maintainers, but existing binaries continue to support core operations without major compatibility breaks for older .deb formats. In practice, wpkg finds use in cross-platform packaging scenarios, particularly in mixed Windows-Unix development environments where teams need to distribute software via standardized .deb files without custom Windows installers. It proves valuable for organizations maintaining legacy -based workflows on Windows desktops or servers, though users may encounter limitations with modern Debian features introduced post-2015.

Other Implementations

dpkg has been adapted for use in non-Debian Linux distributions through conversion tools rather than full native ports. In Slackware, partial integration is achieved via utilities like deb2tgz, which converts Debian (.deb) packages into Slackware's native .tgz format for installation using the system's pkgtools, though dpkg itself is not natively implemented. For RPM-based systems such as Fedora, experimental support for handling .deb packages is provided by the alien tool, which leverages dpkg-deb internals to extract and repackage Debian files into .rpm format, enabling cross-distribution compatibility without requiring a complete dpkg installation. In embedded systems, the incorporates dpkg as an optional package management backend, allowing developers to generate and manage .deb packages within custom images tailored for resource-constrained environments. By setting PACKAGE_CLASSES = "package_deb" in the build , Yocto enables Debian-style alongside its default RPM or IPK options, facilitating hybrid workflows in embedded development. dpkg is also ported to , where it is available as a package in the ports collection, providing Debian package management capabilities on the FreeBSD operating system.

References

  1. [1]
    dpkg(1) - Linux manual page - man7.org
    dpkg is a medium-level tool to install, build, remove and manage Debian packages. The primary and more user-friendly front-end for dpkg as a CLI (command-line ...Actions Top · Options Top · Environment Top<|control11|><|separator|>
  2. [2]
    Chapter 8. The Debian package management tools
    There are multiple tools that are used to manage Debian packages, from graphic or text-based interfaces to the low level tools used to install packages.8.1. 1. Dpkg · 8.1. 2. Apt · 8.1. 6.1. Dpkg-Deb
  3. [3]
    Chapter 4. A Detailed History - Debian
    The earliest packaging tool, written by Ian Murdock and called dpkg, created a package in a Debian-specific binary format, and could be used later to unpack and ...4.5. The 3. X Releases · 4.8. The 6. X Releases · 4.9. The 7. X Releases
  4. [4]
    Teams/Dpkg - Debian Wiki
    ### Summary of Dpkg Team
  5. [5]
    Unlocking the Power of DPKG with Debian Package Management ...
    Mar 14, 2024 · DPKG (Debian Package) is the core package management system in Debian-based Linux distributions. It is responsible for installing, removing, and ...
  6. [6]
    Chapter 2. Debian package management
    The Debian package management system, when used properly, offers the user to install consistent sets of binary packages to the system from the archive.
  7. [7]
  8. [8]
    Brief History of Debian
    Ian Murdock founded Debian in August 1993 and led it until March 1996. Bruce Perens led Debian from April 1996 until December 1997. Ian Jackson led Debian from ...Missing: origins | Show results with:origins
  9. [9]
    Debian GNU/Linux 0.93 release update
    The package maintenance system, called dpkg, makes sure that package ... Version 1.0 and beyond will use the ELF binary format. As always, Debian GNU ...
  10. [10]
    Index of /debian-archive/debian/project/dpkg
    dpkg-1.10.10.tar.gz, 2003-04-26 20:32, 1.5M. [ ], dpkg-1.10.10_alpha-static.nondebbin.tar.gz, 2003-04-28 21:47, 1.8M. [ ], dpkg-1.10.10_alpha.nondebbin.tar.gz ...
  11. [11]
    Bits from the dpkg project: 1.17.x series, general news
    Apr 18, 2015 · * Change directory to «/» before executing maintainer scripts. * Add invoke hooks for dpkg --add-architecture and --remove-architecture. * New ...<|separator|>
  12. [12]
    USN-5446-1: dpkg vulnerability | Ubuntu security notices
    May 26, 2022 · A remote attacker could modify files outside the target unpack directory, leading to a denial of service or potentially gaining access to the system.Missing: changelog | Show results with:changelog
  13. [13]
    dpkg - Debian Package Tracker
    No readable text found in the HTML.<|control11|><|separator|>
  14. [14]
    ReproducibleBuilds - Debian Wiki
    Oct 26, 2025 · Reproducible builds of Debian as a whole is still not a reality, though individual reproducible builds of packages are possible and being ...
  15. [15]
    dpkg(1) - testing - Debian Manpages
    Verifies the integrity of package-name or all packages if omitted, by comparing information from the files installed by a package with the files metadata ...
  16. [16]
    5. Configuration file handling (from old Packaging Manual) - Debian
    dpkg uses a conffile mechanism to handle config files, either by shipping a best-effort config or building it from scratch in the postinst script.
  17. [17]
  18. [18]
    7. Diversions - overriding a package's version of a file (from ... - Debian
    A diversion allows dpkg to not overwrite a file, instead putting it elsewhere, locally or by one package to override another's version.
  19. [19]
    deb-md5sums(5) — dpkg-dev — Debian testing
    This file is used for integrity verification and deduplication purposes, and not for any kind of security purpose. This file contains a list of MD5 digests (as ...
  20. [20]
    7.5. Package signing in Debian
    By following the chain of MD5 sums apt is capable of verifying that a package originates from a a specific release. This is less flexible than signing each ...<|separator|>
  21. [21]
    Multiarch - Debian Wiki
    May 1, 2025 · Dpkg support is available starting from version 1.16.2. Tuple tool: https://code.launchpad.net/~vorlon/+junk/multiarch-tools. Future ...
  22. [22]
    Dpkg with multiarch support available in Debian experimental
    Feb 7, 2012 · As I announced on debian-devel, Guillem Jover uploaded a snapshot of dpkg's multiarch branch to experimental (version 1.16.2~wipmultiarch).
  23. [23]
    deb-control(5) — dpkg-dev — Debian testing
    The syntax of Provides is a list of package names, separated by commas (and optional whitespace). An optional architecture qualifier can also be appended to the ...
  24. [24]
    dpkg(1) - Linux manual page
    ### Summary of dpkg(1) Manual Page Content
  25. [25]
    Debian -- Ports
    Port for the 64-bit little-endian POWER architecture, using the new Open Power ELFv2 ABI. 8, released · riscv64, RISC-V (64-bit little endian), Port for 64-bit ...PowerPC Port · AMD64 Port · Debian Ports · ARM Ports
  26. [26]
    RISC-V - Debian Wiki
    Oct 5, 2025 · This page contains details about a port of Debian for the RISC-V architecture called riscv64, see riscv64 port. For 32 bit (riscv32) see 32 bit RISC-V.Missing: arm64 | Show results with:arm64
  27. [27]
    dpkg(1) — dpkg — Debian unstable — Debian Manpages
    ### Summary of dpkg Database Structure and Related Information
  28. [28]
    deb822(5) — dpkg-dev — Debian unstable
    deb822 - Debian RFC822 control data format ... changes files which control the installation of uploaded files (dpkg's internal databases are in a similar format).
  29. [29]
    dpkg-query(1) — dpkg — Debian unstable - Debian Manpages
    Display details about packages, as found in /var/lib/dpkg/available. If no package-name is specified, it will display all package entries in the available ...
  30. [30]
    dpkg.cfg(5) - Linux manual page - man7.org
    This file contains default options for dpkg. Each line contains a single option which is exactly the same as a normal command line option for dpkg.
  31. [31]
    DpkgTriggers - Debian Wiki
    Jul 8, 2022 · A dpkg trigger is a facility that allows events caused by one package but of interest to another package to be recorded and aggregated, and processed later.Missing: hooks | Show results with:hooks
  32. [32]
    dpkg-trigger(1) - Linux manual page - man7.org
    dpkg-trigger is a tool to explicitly activate triggers and check for its support on the running dpkg. This can be used by maintainer scripts in complex and ...Missing: hooks documentation
  33. [33]
  34. [34]
  35. [35]
  36. [36]
    Change log : dpkg package : Debian
    Summary of each segment:
  37. [37]
    Chapter 6. Building the package - Debian
    To build a Debian package, use `dpkg-buildpackage -us -uc` in the source directory, which cleans, builds source, program, and binary packages.Missing: process | Show results with:process<|separator|>
  38. [38]
    SourceOnlyUpload - Debian Wiki
    Aug 11, 2025 · Source-only are uploads to the Debian archive that do not include a binary build of the Debian package, the buildd network handles the build and distributes it ...Missing: 2024 | Show results with:2024
  39. [39]
    dpkg-source(1) — dpkg-dev — Debian testing - Debian Manpages
    dpkg-source will build the source package with the first format found in this ordered list: the format indicated with the --format command line option, the ...
  40. [40]
    Projects/DebSrc3.0 - Debian Wiki
    Aug 23, 2025 · This page summarizes information concerning the 3.0 (quilt) and 3.0 (native) source package formats that have become the de-facto standard for non-trivial ...
  41. [41]
    ReproducibleBuilds/Howto - Debian Wiki
    The first steps needed to make a package build reproducibly depends on the packaging style. With this, the basics should be covered and simple packages should ...
  42. [42]
    SOURCE_DATE_EPOCH — reproducible-builds.org
    SOURCE_DATE_EPOCH specifies the last modification of something, usually the source code, measured in the number seconds since the Unix epoch.
  43. [43]
    BuildProfileSpec - Debian Wiki
    Oct 16, 2024 · Interaction with ReproducibleBuilds. As of dpkg 1.18.19, build profiles and reproducible builds should become compatible, as the Built-For ...
  44. [44]
    dpkg-source(1) — dpkg-dev — Debian unstable — Debian Manpages
    ### Summary of dpkg-source (dpkg-dev, Debian unstable)
  45. [45]
    dpkg-gencontrol(1) — dpkg-dev — Debian unstable — Debian Manpages
    ### Summary of dpkg-gencontrol (dpkg-dev, Debian unstable)
  46. [46]
    dpkg-distaddfile(1) - Linux manual page - man7.org
    dpkg-distaddfile adds an entry for a named file to debian/files. It takes three non-option arguments, the filename and the section and priority for the . ...
  47. [47]
    dpkg-genchanges(1) — dpkg-dev — Debian unstable
    2025-06-30, 1.22.21. Source file: dpkg-genchanges.1.en.gz (from dpkg-dev 1.22.21). Source last updated: 2025-06-30T23:32:04Z. Converted to HTML: 2025-08-16T15: ...
  48. [48]
    dselect(1): Debian package management frontend - Linux man page
    dselect operates as a front-end to dpkg(1), the low-level debian package handling tool. It features a full-screen package selections manager with package ...
  49. [49]
    dselect - Debian Wiki
    Aug 16, 2019 · dselect was the primary user interface for installing, removing and managing Debian packages. It is the traditional front-end to dpkg.
  50. [50]
    PackageManagementTools - Debian Wiki
    Aug 23, 2025 · dselect - Deprecated: superseded by aptitude. tasksel – Tool for selecting tasks for installation on Debian systems. PackageKit - Distro ...
  51. [51]
    Debian -- Details of package dselect in bookworm
    ### Summary of dselect Package in Debian 12 (bookworm)
  52. [52]
    What are pros/cons of dselect and apt-get?
    Jan 17, 2011 · Dselect is an interactive dpkg front-end that resolves dependencies and conflicts. It lacks most of apt's advanced features: no ...Feeding input values to dpkg-reconfigure in a non-interactive wayWhat's wrong with my dpkg? - Unix & Linux Stack ExchangeMore results from unix.stackexchange.com
  53. [53]
    Chapter 3. DSelect - Debian
    Dselect is a GUI for selecting packages to install or remove. It uses APT to install packages, and the install command performs config and remove.
  54. [54]
    update-alternatives(1) — dpkg — Debian trixie
    update-alternatives creates, removes, maintains and displays information about the symbolic links comprising the alternatives system. It is possible for several ...
  55. [55]
    update-alternatives (from old Packaging Manual) - Debian
    See the update-alternatives(8) man page for details. If update-alternatives does not seem appropriate you may wish to consider using diversions instead. Do not ...
  56. [56]
    DebianAlternatives - Debian Wiki
    Aug 16, 2025 · The update-alternatives program is used to set or display information about the chosen alternative. Some terminology used in this page: An ...Implementation · Changing which alternative is... · Registering a new programme...
  57. [57]
    start-stop-daemon(8) — dpkg — Debian bookworm — Debian Manpages
    ### Summary of start-stop-daemon (https://manpages.debian.org/bookworm/dpkg/start-stop-daemon.8.en.html)
  58. [58]
    Transitions/DpkgToGnuInstallInfo - Debian Wiki
    Sep 13, 2009 · The format of these files is described by the GNU texinfo package, and the support for new features is added to the GNU's install-info (ginstall ...Missing: moved history
  59. [59]
    Microsoft Windows Packager: A Unix Packager For MS-Windows ...
    wpkg can be used to create packages at your development site and then seamlessly install, upgrade, and remove packages at your destribution sites.
  60. [60]
    About Us | Microsoft Windows Packager
    Windows Packager (or wpkg for short) was created and is maintained by Made to Order Software Corporation. We have been working under Unix environments for ...
  61. [61]
    Unix GNU Windows download | SourceForge.net
    Jul 26, 2024 · At this point this project is mainly wpkg which is a replica of dpkg and apt-get that works under Microsoft Windows and Unices.
  62. [62]
    wpkg - Microsoft Windows Packager - SourceForge
    Oct 7, 2012 · wpkg is the actual Windows Packager. The tool used to create, check, install, configure, and remove packages.Missing: port | Show results with:port
  63. [63]
    Unix GNU Windows - Browse /wpkg/0.9.1 at SourceForge.net
    ABOUT WPKG wpkg is a tool used to manage packages under MS-Windows in a way similar to dpkg under Debian (it can actually create packages that are 100 ...
  64. [64]
  65. [65]
    Installing Debian Packages on Slackware | by Chris Crawford | netdef
    Oct 24, 2020 · This approach of using deb2tgz to convert a *.deb to a Slackware package, and then using installpkg to install it should be used as a last ...
  66. [66]
    alien - Fedora Packages
    Alien is a program that converts between the rpm, dpkg, stampede slp, and Slackware tgz file formats. If you want to use a package from another distribution ...
  67. [67]
    How to Convert From RPM to DEB and DEB to RPM Package Using ...
    Jul 14, 2023 · In this article we will introduce you to alien, a tool that converts between different Linux package formats, with .rpm to .deb (and vice versa) ...
  68. [68]
    dpkg - OpenEmbedded Layer Index
    A more low-level and less user-friendly interface is available in the form of the dpkg command.
  69. [69]
    How to add apt package manager in yocto project?
    Feb 16, 2023 · First, you need to configure YP to use Debian package management to create the package feeds. For that set PACKAGE_CLASSES = "package_deb" in build/conf/local. ...
  70. [70]