deb(5)

๐Ÿ’– deb(5) โ€” the Debian binary package format, explained by your favorite Unix bestie ๐Ÿ’–

Okay so bestie, buckle up, because today we're talking about filename.deb โ€” yes, the actual deb(5) manpage from the dpkg suite, and no I will not be normal about it. โœจ


๐ŸŒธ NAME ๐ŸŒธ

deb โ€” the Debian binary package format. That's it, that's the whole vibe. ๐ŸŽ€


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

filename.deb

Honestly? Iconic. A whole format that's just... a filename ending in .deb. She said "my name is my whole identity" and she ATE. ๐Ÿ’…


โœจ DESCRIPTION โœจ

The .deb format is the Debian binary package file format. Periodt. ๐Ÿซถ

It's been supported since dpkg 0.93.76, and it's been generated by default since dpkg 1.2.0 and 1.1.1elf (that's the i386/ELF builds, iykyk). So like, she's been the main character for a minute. ๐Ÿ‘‘

The format we're describing here is the one used since Debian 0.93 โ€” the ancient lore of the old format lives over in deb-old(5) if you're feeling nostalgic. ๐Ÿงš


๐Ÿ”ฅ FORMAT ๐Ÿ”ฅ

So the file is an ar archive with a magic value of !<arch>\n. Not me being obsessed with a magic string, but here we are. ๐Ÿ˜ญ

Only the common ar archive format is supported โ€” no long file name extensions, bestie, we keep it simple. But file names can have an optional trailing slash, which caps their length at 15 characters (out of the 16 allowed). File sizes are limited to 10 ASCII decimal digits, which lets you have member files up to approximately 9536.74 MiB. Big, but not infinite. ๐ŸŒˆ

The tar archives currently allowed are:

  • old-style (v7) format
  • pre-POSIX ustar format
  • a subset of the GNU format
    • Support for new style long pathnames and long linknames since dpkg 1.4.1.17.
    • Support for large file metadata since dpkg 1.18.24.
  • POSIX ustar format
    • Support for long names since dpkg 1.15.0.

Unrecognized tar typeflags are considered an error, no cap. ๐Ÿšจ

By default each tar entry size inside a tar archive is limited to 11 ASCII octal digits, allowing for up to 8 GiB tar entries. The GNU large file metadata support permits 95-bit tar entry sizes and negative timestamps, plus 63-bit UID, GID and device numbers โ€” which basically amounts to practically unlimited values. She's got range. ๐Ÿ’œ


๐ŸŽ€ the ar archive members, in order (this matters, bestie) ๐ŸŽ€

The ar archive is composed of multiple members in a specific order, and the order is NOT a suggestion:

debian-binary

The first required member, containing a series of lines separated by newlines. Currently only one line is present โ€” the format version number, 2.0 at the time this manual page was written. Programs that read new-format archives should be prepared for the minor number to increase and for new lines to show up, and should ignore those if that happens. (Lowkey mature of them. ๐Ÿ™ˆ)

If the major number has changed, an incompatible change has been made and the program should stop. If it has not, then the program should be able to safely continue โ€” unless it encounters an unexpected member in the archive (except at the end), as described below. ๐Ÿ’€

control.tar

The second required member is a tar archive containing the package metadata. It can use the following compression:

  • none
    • Supported since dpkg 1.17.6.
  • gzip (with .gz extension)
  • xz (with .xz extension)
    • Supported since dpkg 1.17.6.
  • zstd (with .zst extension)
    • Supported since dpkg 1.21.18.

It contains a series of plain files:

control

Mandatory control information, in deb822(5) format. Slay.

md5sums, conffiles, triggers, shlibs, symbols

Optional package metadata. The optional girlies. ๐Ÿ’…

preinst, postinst, prerm, postrm

Optional maintainer scripts.

The control tarball may optionally contain an entry for ., the current directory. Cute. ๐ŸŽ€

data.tar

The third and last required member contains the filesystem as a tar archive. It can use the following compression:

  • none
    • Supported since dpkg 1.10.24.
  • gzip (with .gz extension)
  • xz (with .xz extension)
    • Supported since dpkg 1.15.6.
  • zstd (with .zst extension)
    • Supported since dpkg 1.21.18.
  • bzip2 (with .bz2 extension)
    • Supported since dpkg 1.10.24.
  • lzma (with .lzma extension)
    • Supported since dpkg 1.13.25.

These members must occur in this exact order. Current implementations should ignore any additional members after data.tar. Further members may be defined in the future and (if possible) will be placed after these three. ๐ŸŒŸ

Any additional members that may need to be inserted after debian-binary and before control.tar or data.tar โ€” and which should be safely ignored by older programs โ€” will have names starting with an underscore, _.

๐Ÿ’€ And the new members that won't be able to be safely ignored? Those get inserted before data.tar with names starting with something other than underscores, or (more likely) they'll just bump the major version number. So if you see a weird member name, maybe don't panic, but definitely pay attention, bestie.

๐ŸŒˆ MEDIA TYPE ๐ŸŒˆ

Current โœจ

application/vnd.debian.binary-package

The current one. The moment. The it-girl media type. ๐Ÿ‘‘

Deprecated ๐Ÿฅ€

application/x-debian-package
application/x-deb

They're deprecated โ€” still here, still documented, but like... don't build new stuff around them, okay? ๐Ÿ™ˆ


๐Ÿ’– SEE ALSO ๐Ÿ’–

deb-old(5), dpkg-deb(1), deb-control(5), deb-conffiles(5), deb-md5sums(5), deb-triggers(5), deb-shlibs(5), deb-symbols(5), deb-preinst(5), deb-postinst(5), deb-prerm(5), deb-postrm(5).

The whole friend group. Go read them, they're all baddies. ๐Ÿซถ


๐Ÿ“ that's the whole page, bestie! this one's from the dpkg suite, version 1.23.11-dirty, dated 2026-09-09 โ€” drink some water, run dpkg-deb -I on something, and stan responsibly. mwah! ๐Ÿ’‹โœจ
๐Ÿ“ฆ where this page comes from