Skip to content

RFC 822 records

RFC 822 is the 1982 internet standard for electronic mail message headers — the Key: Value format every email header line uses. Debian adopted this format (with minor conventions) for every piece of package metadata it ships, from the binary Packages index on mirrors to the control file inside individual .deb archives.

Ubuntu inherits the format unchanged from Debian, as does every Debian-derived distribution.

Format rules

A record is a sequence of fields:

  • Each field is Key: Value on a single line, with a space after the colon.
  • A field value may span multiple lines. Continuation lines must start with at least one space or tab character.
  • Records are separated by exactly one blank line.
  • Field keys are case-insensitive in principle; in practice Debian uses a consistent canonical casing (Package, Version, Depends).

Example: a Packages.gz record

Package: bash
Version: 5.2.15-2+b10
Architecture: amd64
Depends: libc6 (>= 2.36), libtinfo6 (>= 6)
Pre-Depends: libc6 (>= 2.34)
Provides: bash-static
Filename: pool/main/b/bash/bash_5.2.15-2+b10_amd64.deb
Size: 1472408
SHA256: abc123...
Description: GNU Bourne Again SHell
 Bash is an sh-compatible command language interpreter that
 executes commands read from the standard input or from a file.
Essential: yes

The multi-line Description uses leading-space continuation — canonical RFC 822 syntax.

Where Debian uses it

File Contents
Packages.gz Binary package index — one record per binary package
Sources.gz Source package index
Release Repository metadata (cryptographically signed)
control (inside .deb) Per-package metadata — single record
debian/control (in source tree) Multi-record: one Source: + one Package: per binary produced

flatroot fetches Packages.gz and parses it into the universal package record the resolver operates on. It separates records on blank lines and reads each Key: Value field; a repeated key silently overwrites the earlier value (last occurrence wins — there is no duplicate-key rejection), and continuation lines (the leading-space form a multi-line Description uses) are recognised only to be skipped, so multi-line values never reach the record.

Why RFC 822 and not JSON/YAML/TOML

Debian's package format predates every structured-data format on that list by more than a decade. The format has strengths that have kept it viable: human-readable, line-oriented (grep-friendly), trivially streamable, tolerant of arbitrary-length values, and requires no external parser library. Changing it now would break every Debian tool ever written, and the format has not limited anything Debian wanted to express.

Further reading

  • Appendix / Formats / ar (Unix archive) — ar is one of the oldest Unix archive formats — originally used to pack object files into static libraries (libfoo.a). It is not a compression format: it just concatenates...
    appendix formats
  • Appendix / Formats / cpio (RPM payload) — cpio is a Unix archive format like tar — a stream of (header, filename, content) triples with no central index. It is older than tar, less widespread today, and still used in...
    appendix formats
  • Appendix / Formats / DwarFS — DwarFS — Deduplicating Warp-speed Advanced Read-only File System — is a compressed read-only filesystem optimized for extreme compression while preserving fast random access....
    appendix formats export