Introduction
An .rpm file is a software package for Fedora, Red Hat Enterprise Linux,
openSUSE and the other Linux distributions that use the
RPM Package Manager, first made by Red Hat. It holds the
files to install, the package’s name, version and the other packages it needs, and
scripts to run when it is installed or removed. The rpm tool installs a
single file; DNF and zypper fetch packages and their dependencies from
repositories.
Source packages, which hold the source code and the spec file used to build the
binary packages, end in .src.rpm.
Structure
An RPM file has four parts. The lead is a fixed 96-byte block from the format’s early
days, starting with the magic bytes ED AB EE DB; tools now mostly ignore
it. Then come two headers in the same structure, each starting with
8E AD E8 01: the signature header, holding checksums and signatures of the
rest of the file, and the main header, a table of tagged entries giving the name,
version, dependencies, scripts and file list. The payload follows: a
cpio archive of the files, compressed with gzip, xz or zstd.
The lead’s fields, the header structure with its data types and immutable regions, the signature tags and the payload are on the lead, headers and payload page; every header tag with its number and type is on the header tags page.
0lead, magicED AB EE DB96 bytes96signature header: checksums and signatures, padded to 8 bytesvaries…header: name, version, dependencies, scripts, file listvaries…payload: a compressed cpio archive of the filesvaries
Not described
Known, not yet covered
- Reference: what each tag means (rpm’s “RPM Tags” manual and
rpmtag.hdescribe them); the tags page gives numbers, types and groups only. - Reference: the version 6 package format and the extra tag types it brings; region tag numbers differ between two manual pages and are not settled here.
- Viewer: there is no viewer for RPM files yet.