What Is an RPM Package and How Is It Structured?

An RPM package is the standard software distribution and installation format used by Red Hat Enterprise Linux and its derived distributions. This article explains what an RPM package is, its role in Linux software management, its file naming conventions, and a detailed breakdown of its internal architectural structure—from the legacy lead to the compressed payload containing the software files.

What Is an RPM Package?

RPM, which stands for RPM Package Manager (originally Red Hat Package Manager), is a package management system designed for Linux operating systems. An RPM package is essentially an archive file containing the files that make up a software application, along with metadata required for installation, upgrading, verification, and removal.

Distributions that use the RPM format include Red Hat Enterprise Linux (RHEL), Fedora, CentOS, AlmaLinux, Rocky Linux, and openSUSE. These systems use higher-level package managers like dnf or zypper to resolve dependencies, but the underlying packages installed on the system are RPM files.

RPM Naming Convention

RPM files typically follow a strict naming convention:

name-version-release.architecture.rpm

For example, in httpd-2.4.51-1.el9.x86_64.rpm:

The Internal Structure of an RPM File

Under the hood, an RPM package is a binary file composed of four distinct sections arranged sequentially:

1. The Lead

The Lead is a fixed-size, 96-byte header located at the very beginning of the RPM file. Originally created to identify the file format to the operating system's file command, it contains:

Note: Modern RPM utilities largely ignore the information in the Lead (aside from the magic number) in favor of data found in the Header section.

2. The Signature

The Signature section ensures the integrity and authenticity of the package. It allows the system administrator or package manager to verify that the package has not been corrupted and was issued by a trusted vendor.

3. The Header (Metadata)

The Header contains all the operational metadata describing the package. This section is parsed by package managers like RPM, YUM, or DNF to evaluate compatibility and dependencies without extracting the software. It includes:

4. The Payload

The Payload contains the actual files to be installed on the operating system.