Template:Short description Template:Lowercase title Template:Infobox file format

deb is the format, as well as filename extension of the software package format for the Debian Linux distribution and its derivatives.

DesignEdit

File:Gdebi.png
GDebi installing a .deb package

Debian packages are standard Unix ar archives that include two tar archives. One archive holds the control information and another contains the installable data.<ref name="rh20100917">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

dpkg provides the basic functionality for installing and manipulating Debian packages. Generally end users don't manage packages directly with dpkg but instead use the APT package management software or other APT front-ends such as aptitude (nCurses) and synaptic (GTK).<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

Debian packages can be converted into other package formats and vice versa using alien, and created from source code using checkinstall or the Debian Package Maker.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

Some core Debian packages are available as udebs ("micro debs"), and are typically used only for bootstrapping a Debian installation. Although these files use the udeb filename extension, they adhere to the same structure specification as ordinary deb files. However, unlike their deb counterparts, udeb packages contain only essential functional files.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> In particular, documentation files are normally omitted. udeb packages are not installable on a standard Debian system, but are used in Debian-Installer.

ImplementationEdit

File:Deb File Structure.svg
Diagram showing an example file structure of a .deb file
File:Frhed hex editor displaying deb package.png
Frhed hex editor displaying the raw data of a Debian package

Prior to Debian 0.93, a package consisted of a file header and two concatenated gzip archives.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Since Debian 0.93, a deb package is implemented as an ar archive.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> This archive contains three files in a specific order:<ref name="manpagedeb5">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref name="tldp001">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

  1. debian-binary - A text file named debian-binary containing a single line giving the package format version number. (2.0 for current versions of Debian).<ref name="tldp001"/>
  2. control archive - A tar archive named control.tar contains the maintainer scripts and the package meta-information (package name, version, dependencies and maintainer). Compressing the archive with gzip or xz and zstd is supported. The file extension changes to indicate the compression method.<ref name="tldp001"/><ref name="rh20100917"/>
  3. data archive - A tar archive named data.tar contains the actual installable files. Compressing the archive with gzip, bzip2, lzma or xz and zstd is supported. The file extension changes to indicate the compression method.<ref name="tldp001"/><ref name="rh20100917"/>

Control archiveEdit

The control archive contents can include the following files:

  • control contains a brief description of the package as well as other information such as its dependencies.<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

  • md5sums contains MD5 checksums of all files in the package in order to detect corrupt or incomplete files.<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • conffiles lists the files of the package that should be treated as configuration files. Configuration files are not overwritten during an update unless specified.<ref name="debian-faq-7">{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • preinst, postinst, prerm and postrm are optional scripts that are executed before or after installing or removing the package.<ref name="debian-faq-7"/><ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • config is an optional script that supports the debconf configuration mechanism.<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • shlibs list of shared library dependencies.<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

Signed packagesEdit

Debian-based distributions support OpenPGP signature verification of signed Debian packages, but most (if not all) have this feature disabled by default.<ref name="packagecloud20141028">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Instead packages are verified by signing the repository metadata (i.e. Release files). The metadata files in turn include checksums for the repository files as a means to verify authenticity of the files.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Currently there are two different implementations for signing individual packages. The first is done via the debsigs / debsig-verify toolset, which is supported by dpkg.<ref name="packagecloud20141028"/><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> The second is done through the dpkg-sig program which is not supported by dpkg, so the packages have to be manually checked with the dpkg-sig program.<ref name="packagecloud20141028"/><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Both formats add new sections to the ar archive to store the signature information, but the formats are not compatible with one another.<ref name="packagecloud20141028"/> Neither of the modifications to the package format are listed in the official Debian handbook or man page about the binary package format.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref name="manpagedeb5"/>

AdoptionEdit

|CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> KDE neon, Ubuntu and many others.

  • Fink, a port of dpkg and APT to macOS, uses deb packages.<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

|CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

See alsoEdit

ReferencesEdit

Template:Reflist

External linksEdit

Template:Debian Template:Archive formats Template:Package management systems