Recent from talks
Nothing was collected or created yet.
RPM Package Manager
View on Wikipedia
| RPM Package Manager (RPM) | |
|---|---|
| Original authors | Erik Troan, Marc Ewing,[1] Red Hat |
| Developers | Community & Red Hat[2][3] |
| Initial release | 1997[1] |
| Stable release | |
| Repository | |
| Written in | C, Perl[4] |
| Operating system | Linux, Unix-like |
| Available in | 41 languages[5] |
| Type | Package management system |
| License | GPL |
| Website | rpm |
RPM (originally Red Hat Package Manager, now a recursive acronym for RPM Package Manager) is a free and open-source package management system.[6] The name RPM refers to the .rpm file format and the package manager program itself. RPM was intended primarily for Linux distributions; the file format is the baseline package format of the Linux Standard Base.
Although it was created for use in Red Hat Linux, RPM is now used in many Linux distributions such as PCLinuxOS, Fedora Linux, AlmaLinux, CentOS, openSUSE, OpenMandriva and Oracle Linux. It has also been ported to some other operating systems, such as Novell NetWare (as of version 6.5 SP3), IBM's AIX (as of version 4),[7] IBM i,[8] and ArcaOS.[9] An RPM package can contain an arbitrary set of files. Most RPM files are "binary RPMs" (or BRPMs) containing the compiled version of some software. There are also "source RPMs" (or SRPMs) containing the source code used to build a binary package. These have an appropriate tag in the file header that distinguishes them from normal (B)RPMs, causing them to be extracted to /usr/src on installation. SRPMs customarily carry the file extension ".src.rpm" (.spm on file systems limited to 3 extension characters, e.g. old DOS FAT).
History
[edit]RPM was originally written in 1997 by Erik Troan and Marc Ewing,[1] based on pms, rpp, and pm experiences.
pm was written by Rik Faith and Doug Hoffman in May 1995 for Red Hat Software, its design and implementations were influenced greatly by pms, a package management system by Faith and Kevin Martin in the fall of 1993 for the Bogus Linux Distribution. pm preserves the "Pristine Sources + patches" paradigm of pms, while adding features and eliminating arbitrary limitations present in the implementation. pm provides greatly enhanced database support for tracking and verifying installed packages.[4][10][11]
Features
[edit]For a system administrator performing software installation and maintenance, the use of package management rather than manual building has advantages such as simplicity, consistency and the ability for these processes to be automated and non-interactive. rpm uses Berkeley DB as the backend database although since 4.15 in 2019, it supports building rpm packages without Berkeley DB (–disable-bdb).[12]
Features of RPM include:
- RPM packages can be cryptographically verified with GPG and MD5
- Original source archive(s) (e.g.
.tar.gz,.tar.bz2) are included in SRPMs, making verification easier - Delta update: PatchRPMs and DeltaRPMs, the RPM equivalent of a patch file, can incrementally update RPM-installed software
- Automatic build-time dependency evaluation.
Local operations
[edit]Packages may come from within a particular distribution (for example Red Hat Enterprise Linux) or be built for it by other parties (for example RPM Fusion for Fedora Linux).[13] Circular dependencies among mutually dependent RPMs (so-called "dependency hell") can be problematic;[14] in such cases a single installation command needs to specify all the relevant packages.
Repositories
[edit]RPMs are often collected centrally in one or more repositories on the internet. A site often has its own RPM repositories which may either act as local mirrors of such internet repositories or be locally maintained collections of useful RPMs.
Front ends
[edit]Several front-ends to RPM ease the process of obtaining and installing RPMs from repositories and help in resolving their dependencies. These include:
- yum used in Fedora Linux, CentOS 5 and above, Red Hat Enterprise Linux 5 and above, Scientific Linux, Yellow Dog Linux and Oracle Linux
- DNF, introduced in Fedora Linux 18 (default since 22), Red Hat Enterprise Linux 8, AlmaLinux 8, and CentOS Linux 8.
- up2date used in Red Hat Enterprise Linux, CentOS 3 and 4, and Oracle Linux
- Zypper used in Mer (and thus Sailfish OS), MeeGo,[15] openSUSE and SUSE Linux Enterprise
- urpmi used in Mandriva Linux, ROSA Linux and Mageia
- apt-rpm, a port of Debian's Advanced Packaging Tool (APT) used in Ark Linux,[16] PCLinuxOS and ALT Linux
- Smart Package Manager, used in Unity Linux, available for many distributions including Fedora Linux.
rpmquery, a command-line utility available in (for example) Red Hat Enterprise Linuxlibzypp, for Sailfish OS
Local RPM installation database
[edit]Working behind the scenes of the package manager is the RPM database, stored in /var/lib/rpm. It uses Berkeley DB as its back-end. It consists of a single database (Packages) containing all of the meta information of the installed RPMs. Multiple databases are created for indexing purposes, replicating data to speed up queries. The database is used to keep track of all files that are changed and created when a user (using RPM) installs a package, thus enabling the user (via RPM) to reverse the changes and remove the package later. If the database gets corrupted (which is possible if the RPM client is killed), the index databases can be recreated with the rpm --rebuilddb command.[17]
Description
[edit]Whilst the RPM format is the same across different Linux distributions, the detailed conventions and guidelines may vary across them.
Package filename and label
[edit]An RPM is delivered in a single file, normally with a filename in the format:
<name>-<version>-<release>.src.rpmfor source packages, or<name>-<version>-<release>.<architecture>.rpmfor binaries.
For example, in the package filename libgnomeuimm-2.0-2.0.0_3.i386.rpm, the <name> is libgnomeuimm, the <version> is 2.0, the <release> is 2.0.0_3, and the <architecture> is i386.
The associated source package would be named libgnomeuimm-2.0-2.0.0_3.src.rpm
RPMs with the noarch.rpm extension do not depend on a particular CPU architecture. For example, these RPMs may contain graphics and text for other programs to use. They may also contain shell scripts or programs written in other interpreted programming languages such as Python.
The RPM contents also include a package label, which contains the following pieces of information:
- software name
- software version (the version taken from original upstream source of the software)
- package release (the number of times the package has been rebuilt using the same version of the software). This field is also often used for indicating the specific distribution the package is intended for by appending strings like "mdv" (formerly, "mdk") (Mandriva Linux), "mga" (Mageia), "fc4" (Fedora Core 4), "rh9" (Red Hat Linux 9), "suse100" (SUSE Linux 10.0) etc.
- architecture for which the package was built (i386, i686, x86_64, ppc, etc.)
The package label fields do not need to match the filename.
Library packaging
[edit]Libraries are distributed in two separate packages for each version. One contains the precompiled code for use at run-time, while the second one contains the related development files such as headers, etc. Those packages have "-devel" appended to their name field. The system administrator should ensure that the versions of the binary and development packages match.
Binary format
[edit]The format is binary and consists of four sections:[6]
- The lead, which identifies the file as an RPM file and contains some obsolete headers.
- The signature, which can be used to ensure integrity and/or authenticity.
- The header, which contains metadata including package name, version, architecture, file list, etc.
- A file archive (the payload), which usually is in cpio format, compressed with gzip. The
rpm2cpiotool enables retrieval of the cpio file without needing to install the RPM package.[18]
SPEC file
[edit]The "Recipe" for creating an RPM package is a spec file. Spec files end in the ".spec" suffix and contain the package name, version, RPM revision number, steps to build, install, and clean a package, and a changelog. Multiple packages can be built from a single RPM spec file, if desired. RPM packages are created from RPM spec files using the rpmbuild tool.
Spec files are usually distributed within SRPM files, which contain the spec file packaged along with the source code.
SRPM
[edit]A typical RPM is pre-compiled software ready for direct installation. The corresponding source code can also be distributed. This is done in an SRPM, which also includes the "SPEC" file describing the software and how it is built. The SRPM also allows the user to compile, and perhaps modify, the code itself.
A software package could contain only platform independent scripts. In such a case, the developer could provide only an SRPM, which is still an installable RPM.
NOSRC
[edit]This is a special version of SRPM. It contains "SPEC" file and optionally patches, but does not include sources (usually because of license).[21]
Forks
[edit]As of June 2010[update], there are two versions of RPM in development: one led by the Fedora Project and Red Hat, and the other by a separate group led by a previous maintainer of RPM, a former employee of Red Hat.
RPM.org
[edit]The rpm.org community's first major code revision was in July 2007; version 4.8 was released in January 2010, version 4.9 in March 2011, 4.10 in May 2012, 4.11 in January 2013, 4.12 in September 2014 and 4.13 in July 2015.
This version is used by distributions such as Fedora Linux, Red Hat Enterprise Linux and derivatives, openSUSE, SUSE Linux Enterprise, Unity Linux, Mageia,[22] OpenEmbedded, Tizen and OpenMandriva Lx (formerly Mandriva).
RPM v5 (Defunct)
[edit]Jeff Johnson, the RPM maintainer since 1999, continued development efforts together with participants from several other distributions. RPM version 5 was released in May 2007.
This version was used by distributions such as Wind River Linux (until Wind River Linux 10), Rosa Linux, and OpenMandriva Lx (former Mandriva Linux which switched to rpm5 in 2011[23]) and also by the OpenPKG project which provides packages for other common UNIX-platforms.
OpenMandriva Lx has switched back to rpm.org[24] for 4.0 release.[needs update]
OpenEmbedded, the last major user of RPM5, switched back to rpm.org due to issues in RPM5.[25][26]
See also
[edit]- Autopackage — a "complementary" package management system
- Delta ISO — an ISO image which contains RPM Package Manager files
- dpkg — package management system used by Debian and its derivatives
- List of RPM-based Linux distributions
- pkg-config — queries libraries to compile software from its source code
References
[edit]- ^ Spevack, Max (14 December 2006). "RPM -- plans, goals, etc". fedora-announce-list (Mailing list). Archived from the original on 6 October 2012. Retrieved 20 January 2011.
- ^ "RPM.org FAQ". rpm.org. Archived from the original on 5 November 2016. Retrieved 25 August 2013.
- ^ a b Bailey 2000, pp. 22–25, Chapter 1: An Introduction to Package Management
- ^ "po/LINGUAS". GitHub. Archived from the original on 23 April 2022. Retrieved 23 September 2025.
- ^ a b Bailey 2000, pp. 325–336, Appendix A: Format of the RPM File
- ^ Mallayya, Sangamesh; Mishra, Nitish; Rathi, Sanket; Ayappan p (24 October 2018). "Configuring YUM and creating local repositories on IBM AIX". developer.ibm.com. Archived from the original on 3 October 2020. Retrieved 3 September 2020.
- ^ Woodie, Alex (18 July 2018). "RPM and Yum are a big deal for IBM i. Here's why". IT Jungle. Archived from the original on 29 June 2019. Retrieved 3 September 2020.
- ^ "Package Manager". arcanoae.com. Archived from the original on 25 March 2016. Retrieved 4 September 2020.
- ^ "RPM Design Goals". docs.fedoraproject.org. Archived from the original on 21 March 2014. Retrieved 14 April 2014.
- ^ "BOGUS Announce". ibiblio.org. Archived from the original on 4 November 2013. Retrieved 14 April 2014.
- ^ zoujiaqing (29 January 2020). "rpm4 was support for building rpm without Berkeley DB (–disable-bdb)". The FreeBSD Forums. Archived from the original on 23 February 2024. Retrieved 18 September 2023.
- ^ "RPM Fusion". rpmfusion.org. Archived from the original on 11 February 2019. Retrieved 22 November 2010.
- ^ Hart, John; D'Amelia, Jeffrey. An Analysis of RPM Validation Drift (PDF). Proceedings of LISA '02: Sixteenth Systems Administration Conference. Berkeley, CA: USENIX Association. pp. 155–166. Archived (PDF) from the original on 28 July 2011. Retrieved 15 March 2011.
- ^ "Zypper". MeeGo wiki. Archived from the original on 25 September 2013. Retrieved 14 April 2014.
- ^ "FAQs: About the Projects". Ark Linux Official Site. Archived from the original on 11 February 2012. Retrieved 14 April 2014.
- ^ "Repair an RPM database safely". oldrpm.org. Archived from the original on 6 August 2019. Retrieved 11 November 2011.
- ^ "Supplemental Packaging Software". Fedora Project. Archived from the original on 10 March 2016. Retrieved 11 November 2011.
- ^ "Switch RPMs to zstd compression". Fedora Project (Wiki). Archived from the original on 2 June 2019. Retrieved 2 June 2019.
- ^ "[PATCH] Add lzip support". rpm.org. Archived from the original on 4 March 2016. Retrieved 24 October 2013.
- ^ Suchý, Miroslav (10 December 2014). "How to package proprietary software". Red Hat Developers. Archived from the original on 2 July 2018. Retrieved 2 July 2018.
- ^ "Mageia 3 Release Notes: Package management". mageia.org. 19 May 2013. Archived from the original on 7 February 2014. Retrieved 14 April 2014.
- ^ Bodnar, Ladislav & Smith, Jesse (22 November 2010). "DistroWatch Weekly". DistroWatch. Archived from the original on 23 June 2018. Retrieved 22 November 2010.
Mandriva looks to abandon the unmaintained RPM 4.x series and replace it with RPM 5.x for better package management.
- ^ Gajc, Tomasz Paweł. "Forum: Switching to RPMv4". forum.openmandriva.org. Archived from the original on 14 January 2022. Retrieved 3 March 2018.
- ^ "YP Core – Pyro 2.3". Yocto Project. 12 May 2017. Archived from the original on 5 December 2017. Retrieved 4 December 2017.()
- ^ Kanavin, Alexander (14 February 2017). "[Openembedded-architecture] Changes that switching from smart to dnf will cause". openembedded-architecture (Mailing list). Yocto Project. Archived from the original on 5 November 2018. Retrieved 4 November 2018.
- Schroeder, Jeff (30 January 2008). "Advanced RPM query strings". www.digitalprognosis.com. Archived from the original on 9 August 2011. Retrieved 28 March 2018.
- Bailey, Edward C. (2000). Maximum RPM: Taking the Red Hat Package Manager to the Limit. Red Hat, Inc. ISBN 978-1-888172-78-2. OCLC 36758622. OL 8710068M. Retrieved 13 August 2013.
External links
[edit]- Official website

- "RPM and DPKG command reference". packman.linux.is. Archived from the original on 28 October 2016. Retrieved 23 September 2025.
- Frye, Matt (8 February 2007). "The story of RPM". Red Hat Magazine. Archived from the original on 1 February 2013. Retrieved 23 September 2025.
- "Packaging Tutorial". docs.fedoraproject.org. Retrieved 23 September 2025. - How to create an RPM package
- msamir. "RPM". MSamir. Archived from the original on 9 November 2009. Retrieved 23 September 2025. - Video tutorials for Building and Patching the RPMs
- "RPM Notes - Building RPMs the easy way". grahams.free-online.co.uk. Archived from the original on 5 May 2013. Retrieved 23 September 2025.
- Poirier, Dan (November 2001). "Packaging software with RPM, Part 1". www-106.ibm.com. Archived from the original on 7 February 2002. Retrieved 23 September 2025.
- Shields, Ian (11 May 2010). "Learn Linux, 101: RPM and YUM package management". ibm.com. Archived from the original on 16 May 2010. Retrieved 23 September 2025.
RPM Package Manager
View on GrokipediaIntroduction
Definition and Purpose
The RPM Package Manager (RPM) is a free and open-source package management system and associated file format designed for distributing, installing, updating, and managing software on Linux and Unix-like systems.[4] Originally developed for Red Hat Linux, with its first version committed in 1995, RPM provides a standardized approach to software packaging that promotes consistency across distributions.[10] It serves as a core component in major Linux ecosystems, enabling administrators and users to handle software efficiently through command-line tools.[7] The primary purposes of RPM include managing both binary and source packages to ensure reliable software distribution and installation.[4] It supports dependency resolution by tracking required libraries, executables, and other components, automatically resolving conflicts or missing prerequisites during package operations to maintain system stability.[7] Additionally, RPM enforces consistency in software deployment by standardizing package contents and behaviors, reducing errors in multi-system environments.[9] Files with the .rpm extension represent individual software packages that encapsulate compiled binaries, libraries, configuration files, and documentation alongside essential metadata such as package name, version, architecture, and installation instructions.[7] This structure also includes executable scripts for pre- and post-installation tasks, allowing packages to perform custom actions like starting services or updating databases.[7] Source RPMs (.srpm) extend this by including original source code and build specifications, facilitating transparency and customization.[7] RPM enables reproducible builds by allowing users to compile identical binaries from source RPMs using the same specifications, ensuring verifiable and consistent software across environments.[7] It also supports system integrity checks through features like file verification against checksums and digital signatures, helping detect tampering or corruption in installed packages.[4] These capabilities collectively enhance security and reliability in software management.[9]Adoption in Linux Distributions
The RPM Package Manager was initially adopted by Red Hat Linux in 1995 as its primary packaging system, providing a standardized method for distributing software that facilitated easy installation and updates across systems.[11] This foundation extended to subsequent Red Hat projects, including Fedora as a community-driven upstream distribution, and enterprise-focused variants like Red Hat Enterprise Linux (RHEL), where RPM remains integral via frontends such as DNF for dependency resolution and repository management. RHEL derivatives, including CentOS Stream, Rocky Linux, and AlmaLinux, have similarly embraced RPM to ensure compatibility and long-term support for server and workstation deployments.[12] Beyond Red Hat ecosystems, RPM gained traction in other distributions for its robust binary format and metadata handling. openSUSE and SUSE Linux Enterprise utilize RPM packages managed through the zypper frontend, enabling seamless integration with YaST for graphical configuration and supporting both rolling-release and stable branches.[13] Mageia, a community fork of Mandriva, employs RPM with tools like URPMI and DNF for package handling, emphasizing user-friendly updates and multimedia support in desktop environments.[14] Similarly, PCLinuxOS leverages RPM via its APT-RPM system, combining Debian-style repository management with RPM's verification features to cater to independent users seeking a lightweight, customizable setup.[15] In enterprise environments, RPM's adoption underscores its emphasis on stability, with RHEL's long support cycles and cryptographic verification ensuring reliable deployments in data centers and cloud infrastructures. Community distributions, in contrast, highlight RPM's flexibility, allowing rapid iteration and custom repositories that appeal to developers and hobbyists without compromising core integrity. As of 2025, RPM-based systems maintain a strong presence in Linux package management, particularly in servers where RHEL commands approximately 43.1% of the enterprise Linux server market share, driving adoption in hybrid cloud and edge computing scenarios.[16] On desktops, RPM distributions like Fedora contribute to Linux's approximately 4% global desktop market share as of 2025, bolstered by upstream innovations that influence broader ecosystem tools.[17] RPM integrates natively with containerization via Podman, a daemonless tool developed by Red Hat and installable as an RPM package on RHEL and Fedora, enabling secure, rootless container workflows that align with RPM's security model.[18] It also demonstrates compatibility with universal formats like Flatpak and AppImage, allowing hybrid packaging where RPM handles system-level components while Flatpak delivers sandboxed applications across RPM-based distros such as Fedora and RHEL.[19]History
Origins and Early Development
The RPM Package Manager (RPM) was developed in 1995 by Marc Ewing and Erik Troan, engineers at Red Hat Software, as a solution for managing software packages in the burgeoning Linux ecosystem.[20][21] This tool emerged from the need to create a more reliable system than existing ad-hoc methods for distributing and installing software on Unix-like systems, particularly to support the rapid growth of Linux distributions. At the time, Linux was transitioning from academic and hobbyist use to broader adoption, requiring tools that could automate updates, track installations, and resolve dependencies without manual intervention.[22] RPM's design was heavily influenced by earlier package management systems, including PM (developed in 1995 for Red Hat by Rik Faith and Doug Hoffman, building on experiences with PMS—a package manager from Transarc Corporation used for the Andrew File System (AFS) and in the 1993–1994 BOGUS Linux distribution by Faith, Hoffman, and Kevin Martin)—and rpp, an internal Red Hat tool for handling software bundles. These predecessors provided foundational ideas like scriptable installations and basic verification but suffered from limitations in scalability and cross-system compatibility, prompting Red Hat to unify and enhance them into a robust, open framework.[22][23] The initial version of RPM, version 1.0, debuted in the beta release of Red Hat Linux 2.0 in late summer 1995, marking the first widespread use of a database-driven package manager in a major Linux distribution.[24] This integration focused on streamlining software deployment for users and administrators, with RPM handling binary packages that included metadata for dependencies and file integrity checks. Early adoption was tied closely to Red Hat's efforts to commercialize Linux, but challenges arose from the absence of industry-wide standards, making integration with other emerging distributions difficult and leading to fragmented tooling in the late 1990s.[21]Key Milestones and Version Evolution
The RPM Package Manager underwent significant evolution following its initial development, with key advancements in version releases that enhanced dependency resolution, scripting capabilities, and backend storage. RPM 3.0 was released in 1999. In 2000, the project was renamed from Red Hat Package Manager to the more neutral RPM Package Manager on January 17, marking a shift toward broader adoption beyond Red Hat ecosystems.[10] This version introduced improvements in payload compression support, such as bzip2 in subsequent 3.0.x updates, laying groundwork for more efficient package handling.[25] RPM 4.0, released in 2002, represented a major overhaul, adopting a new database format based on Berkeley DB to enable better performance and dependency resolution, allowing older and newer RPM versions to coexist during upgrades.[25] This change facilitated more robust handling of package interdependencies, reducing conflicts in complex installations. The project had been open-sourced under a dual GPL/LGPL license since 1997, promoting widespread contributions and integration into various Linux distributions.[10] In 2008, RPM 5.0 was released as a fork led by Jeff Johnson, diverging from the mainline rpm.org development to incorporate features like enhanced internationalization and delta RPM support for efficient updates; however, it saw limited adoption and became defunct by the 2010s, with no significant updates after around 2013.[26][27] Mainline development continued with RPM 4.x series enhancements, including the introduction of Lua scripting integration around 2012 for extensible spec file processing and automation. Later milestones in the 4.x series focused on advanced scripting and storage flexibility. RPM 4.13, released in 2016, added file triggers, enabling packages to execute scripts in response to file installations or removals by other packages, improving post-installation automation like database updates.[10] In 2019, RPM 4.15 introduced an optional SQLite backend alongside the traditional Berkeley DB, offering a lighter, more modern alternative for the package database to address maintenance concerns with the aging DB library.[10] This transition enhanced portability and reduced dependencies in embedded or minimal environments. A pivotal integration event occurred in 2015, when DNF (Dandified YUM), the next-generation frontend for RPM, became the default package manager in Fedora 22, leveraging RPM's core for dependency solving via the libsolv library and improving overall repository management efficiency.[28][29] The most recent major milestone is the stable release of RPM 6.0.0 on September 22, 2025, which enforces signature checking by default, supports multiple OpenPGP signatures per package, introduces the RPM v6 file format, and incorporates post-quantum cryptography (PQC) keys for future-proofed security.[30] These updates also streamline build processes through refined plugin APIs and documentation enhancements, boosting efficiency in package creation and verification.[31]Core Features
Dependency Management
The RPM Package Manager employs a metadata-based system to manage software dependencies, utilizing tags such as Provides, Requires, Obsoletes, and Conflicts within package specifications to enable automatic checking during installation and upgrades.[32] The Provides tag allows a package to declare capabilities it offers, such as specific binaries or libraries (e.g.,Provides: /bin/sh), which other packages can require without tying to a particular provider, facilitating virtual dependencies for alternatives like multiple shell implementations.[32] Requires specifies mandatory prerequisites, including other packages or capabilities, ensuring they are present before or alongside the current package's installation.[32] Obsoletes identifies superseded packages, prompting their removal during upgrades to treat the new package as a replacement, while Conflicts prevents co-installation of incompatible packages by blocking if a matching capability exists.[32]
Dependency evaluation occurs primarily at runtime during package installation or upgrades, where RPM verifies that all Requires are satisfied against the system's database of installed capabilities; build-time evaluation, however, is managed separately to ensure prerequisites for compilation are met without affecting end-user installations.[32] RPM distinguishes between strong dependencies (Requires, Conflicts, Obsoletes) and weaker ones, such as Recommends (optional forward suggestions) and Suggests (very weak forward hints), which are processed or displayed but not enforced to avoid installation failures.[32] Automatic dependencies, like those generated for shared libraries via sonames, are inferred by RPM tools without explicit tagging, enhancing efficiency for common runtime needs.[32]
Versioned dependencies in RPM support precise control using operators like >= or <, formatted as [epoch:]version[-release] (e.g., Requires: perl >= 9:5.00502-3), allowing requirements for minimum or exact versions to maintain compatibility across updates.[32] Virtual provides extend this by enabling abstract capability declarations, such as for interchangeable libraries (e.g., different implementations of a database driver), resolved at runtime without mandating specific package names.[32]
During package creation, the rpmbuild tool resolves dependencies by checking build-time Requires against available sources, generating the necessary metadata tags to embed in the resulting RPM file for later runtime use.[32]
Core RPM lacks built-in automatic dependency resolution, requiring manual satisfaction of unsatisfied Requires or delegation to higher-level front-ends like YUM or DNF for automated solving across repositories.[11] This design can lead to dependency issues, or "dependency hell," in complex systems with intricate versioning chains or solver limitations, where conflicts arise that prevent straightforward installations.[32]
Package Verification and Security
RPM employs GPG signatures to verify the authenticity of packages, ensuring they originate from trusted sources and have not been altered by unauthorized parties during distribution. This process involves signing the package header and payload using tools like rpmsign, with verification performed via therpm --checksig command, which checks against imported public keys in the system's RPM keyring.[33] For integrity, RPM calculates and stores checksums such as MD5, SHA1, and SHA256 to detect any corruption or tampering in the package contents, with the rpm -K or --checksig options confirming matches against these digests.[34]
These verification mechanisms are implemented directly within the .rpm file structure, where the signature header contains tags like Sigpgp for OpenPGP DSA signatures of the header and payload, and digest tags such as SHA256 for the header itself and the compressed payload, enabling end-to-end checks from download to installation.[35] Since RPM 4.14, SHA256 digests have been mandatory for enhanced security, replacing weaker MD5/SHA1 where possible, while maintaining backward compatibility.[36]
Delta RPMs facilitate secure, bandwidth-efficient updates by generating binary patches (deltas) between an installed package and its newer version, which are then applied using the applydeltarpm utility to reconstruct the full updated package. These deltas inherit the same GPG signing and checksum verification as standard RPMs, ensuring integrity and authenticity before application, thus minimizing exposure during transfers over untrusted networks.[37]
To enforce runtime security, RPM supports POSIX file capabilities, allowing packages to assign fine-grained privileges to executables via extended attributes (e.g., cap_net_bind_service for binding to privileged ports without full root access), specified in SPEC files using the %caps macro or %attr with capability flags, reducing the attack surface compared to traditional setuid binaries. Additionally, RPM triggers enable runtime security adjustments by executing custom scripts during package events like installation or upgrades of dependent packages, such as applying SELinux contexts or updating access controls to maintain system policy compliance.[38]
RPM has addressed several historical vulnerabilities in package verification and signature handling, including CVE-2011-3378, a memory corruption flaw in header parsing that could enable denial-of-service or arbitrary code execution via malformed packages; this was mitigated in version 4.9.1.2 through strengthened validation before signature checks.[39]
Modern RPM versions (4.14 and above) support integration with UEFI Secure Boot by allowing kernel modules and bootloaders packaged as RPMs to be signed with X.509 certificates, enabling their verification and loading on Secure Boot-enabled systems after enrolling the distributor's public key in the firmware's trusted database.[40]
Package Format and Components
Binary RPM Structure
The binary RPM file follows a structured layout consisting of four primary components: the lead, signature, header, and payload. The lead is a fixed 96-byte section at the beginning of the file that identifies it as an RPM package. It starts with the magic bytes 0xED 0xAB 0xEE 0xDB, followed by the major and minor version numbers (typically 4.0 for modern formats), a package type indicator (0x00 for binary packages), architecture and OS identifiers, a reserved name field, and additional reserved bytes. This section ensures basic file recognition and provides initial metadata redundancy.[41][42] The signature follows the lead and contains cryptographic elements for verifying the package's integrity and authenticity. It is structured as a header-like region with tags such as HEADERSIGNATURES (tag 62) indicating the presence of signatures, along with hash values like MD5 (tag 1004), SHA1 (tag 269), and SHA256 (tag 272) for the header and payload. Signature types include public key methods like RSA (tag 268), DSA (tag 267), and PGP variants, with the data padded to multiples of 8 bytes. In binary RPMs, this section authenticates the compiled content without altering the payload itself.[34][42] The header, immediately after the signature, stores the package's metadata in a flexible tag-value format divided into immutable and mutable regions. The immutable section (tagged with RPMTAG_HEADERIMMUTABLE, tag 63) contains core attributes like name (tag 1000), version (tag 1001), release (tag 1002), architecture (tag 1003), and build time (tag 1006), using data types such as strings, integers, or arrays. The mutable section allows for less critical data, such as file lists or dependencies. Tags are indexed with 16-byte entries specifying the tag number, type, offset, and count, enabling efficient parsing; over 60 tags are defined, with binary RPM headers emphasizing details on compiled binaries and libraries rather than source code. This structure supports larger headers in later versions through 64-bit indexing.[41][34] The payload forms the bulk of the binary RPM, comprising a compressed archive of the installed files using the cpio format (SVR4 with CRC). It includes compiled executables, libraries, documentation, and configuration files, distinguished from source RPMs by containing pre-built binaries optimized for the target architecture rather than raw source tarballs and patches. Compression algorithms include gzip (default, with magic bytes 0x1F 0x8B), bzip2, xz, and lzma, configurable via build macros; the archive lists files with permissions, ownership, and timestamps. Scriptlets—executable scripts for pre-install, post-install, pre-uninstall, and post-uninstall actions—are embedded as special cpio entries, allowing runtime behaviors like user creation or service starts specific to binary deployment.[41][34] The RPM binary format has evolved significantly from version 3 to 6 to address limitations in size, security, and compatibility. Version 3 (circa 1997) used a simpler 96-byte lead and basic MD5 signatures, with headers limited to 16-bit indices and no support for payloads over 4 GB. Version 4 (introduced around 2002) added immutable header regions, header-only signatures, compressed file paths for efficiency, and 64-bit integer support (from 4.6), enabling larger packages and better verification. Further enhancements in 4.12 allowed payloads exceeding 4 GB via extended cpio magic (07070X), while 4.14 mandated SHA256 for stronger hashes. RPM 6.0 (released September 2025) introduces the v6 format with full 64-bit limits, drops legacy MD5/SHA1 support, adds SHA3-256 digests and per-file MIME types, supports multiple OpenPGP v6 signatures and post-quantum cryptography, and uses UTF-8 encoding with a new payload format featuring hex file indices for unlimited sizes—all while maintaining backward compatibility for querying and unpacking with RPM 4.x tools. These changes enhance security and scalability for modern binary distributions without breaking existing ecosystems.[41][34][42][30]Source RPMs and SPEC Files
Source RPMs (SRPMs) are RPM packages with the file extension.src.rpm that contain the original source code tarballs, any applied patches, and a SPEC file, enabling reproducible builds of binary RPMs from source.[43] These packages preserve the exact sources used for a given binary RPM version, facilitating debugging, auditing, and adaptation across different architectures or environments.[44]
The SPEC file, typically named with a .spec extension, serves as the build recipe within an SRPM, providing instructions for the rpmbuild tool to construct binary packages. It consists of two main parts: the preamble and the body. The preamble contains metadata tags such as Name (the package base name), Version (upstream version number), Release (packager's release count), Summary (brief description), License (software license), URL (upstream project site), Source0 (primary source archive URL or path), Patch0 (first patch file), BuildRequires (build-time dependencies), and Requires (runtime dependencies).[45] For example:
Name: example-package
Version: 1.0
Release: 1%{?dist}
Summary: An example package
License: GPLv2+
URL: https://example.com
Source0: https://example.com/releases/%{name}-%{version}.tar.gz
BuildRequires: gcc
Requires: bash
Name: example-package
Version: 1.0
Release: 1%{?dist}
Summary: An example package
License: GPLv2+
URL: https://example.com
Source0: https://example.com/releases/%{name}-%{version}.tar.gz
BuildRequires: gcc
Requires: bash
%description for a detailed package overview, %prep for unpacking sources and applying patches (e.g., using %autosetup or %patch0), %build for compiling the software (e.g., %make_build), %install for placing built files into a temporary build root (e.g., %make_install), %files for specifying which files to include in the final package with attributes like %attr(755, root, root) for permissions, and %changelog for recording version changes in a standardized format such as * Date Packager <email> - Version-Release.[44] SPEC files also employ macros—parameterized text substitutions like %{name} for the package name or %{buildroot} for the installation directory—to enhance portability and readability; these can be defined with %define or %global and evaluated via rpm --eval.[45]
The build process begins with preparing the environment using rpmdev-setuptree to create standard directories like SOURCES, SPECS, and SRPMS, followed by placing source tarballs in SOURCES and the SPEC file in SPECS. Invoking rpmbuild -bs <specfile> generates the SRPM from the SPEC file, while rpmbuild -bb <specfile> or rpmbuild --rebuild <srpm> produces binary RPMs by executing the SPEC sections sequentially: unpacking in %prep, compiling in %build, installing in %install, and packaging in %files.[43] This process ensures automated, repeatable package creation, with options like --short-circuit to test specific stages.[46]
NOSRC packages, identifiable by the .nosrc.rpm extension, are a variant of SRPMs that omit source code tarballs, relying instead on patches, generated content during the build, or external sources for cases like proprietary software or documentation-only distributions.[45] They are created when dynamic build dependencies are unresolved (e.g., via %generate_buildrequires), producing a package with BuildRequires metadata but no sources to resolve missing tools. Directives like NoSource: <filename> in the SPEC file exclude specific files from the SRPM payload.[46]
The use of SRPMs and SPEC files offers key advantages, including the ability to audit package builds for security and compliance by inspecting sources and instructions, perform custom recompilations with modified patches or flags, and distribute build recipes independently of binaries to support community contributions or architecture-specific adaptations.[44]
Package Naming and Metadata
RPM packages follow a standardized filename convention to ensure clarity and consistency in distribution and management. The typical format isname-version-release.architecture.rpm, where name is the base package identifier, version represents the upstream software version, release indicates the distributor's release number (often including a distribution tag like .el7 for Enterprise Linux 7), and architecture specifies the target platform such as x86_64 or noarch for architecture-independent packages.[47] For example, bash-5.1-3.x86_64.rpm denotes the Bash shell package at version 5.1, third release, for 64-bit x86 systems.[47]
To handle complex version precedence, RPM uses an optional epoch field, forming a full version label of name-epoch:version-release. The epoch, an integer typically starting at 0 if omitted, takes priority in comparisons; a higher epoch overrides even newer version-release combinations, allowing distributors to enforce ordering for rebuilt or forked packages.[35]
Key metadata tags embedded in the RPM header provide essential information for package handling and user reference. These include Name (the package base name), Version (upstream version string), Release (distributor release), Epoch (version precedence integer), Summary (a concise one-line description of the package's purpose), Description (a detailed multiline explanation), License (the software's licensing terms, such as GPLv3+), Group (a categorization like "Applications/System"), Requires (runtime dependencies as a string array), Provides (capabilities or virtual names supplied by the package), BuildTime (Unix timestamp of the build), and Vendor (contact details for the packager or organization).[35] These tags, stored in the binary header, enable tools to query and resolve package attributes without extracting contents.[35]
For shared libraries, RPM packaging emphasizes soname handling to maintain ABI compatibility. The soname (shared object name), embedded during compilation with flags like -Wl,-soname,libexample.so.1, identifies the library's major version for dynamic linking; tools like objdump verify it post-build.[48] Runtime dependencies automatically include sonames via Requires, while development files (headers, pkg-config data, and unversioned symlinks like libexample.so) are separated into -devel subpackages to minimize base package size and avoid unnecessary installations.[48] The -devel package requires the exact version of the base library package for consistency.[48]
Best practices for RPM naming and metadata focus on uniqueness and usability to prevent conflicts and support diverse environments. Package names should use lowercase letters and dashes (e.g., httpd-tools instead of httpd_tools) to align with filesystem conventions and avoid overlaps.[49] Metadata like Summary and Description supports internationalization through i18nstring tags, allowing locale-specific translations via tools like %find_lang in build processes.[48] To avoid conflicts, explicit file listings in SPEC files (rather than globs) ensure precise ownership, and unique Provides declarations help resolve virtual dependencies across packages.[48]
Database and Local Operations
Installation Database
The RPM installation database serves as the central local record of all software packages installed on a system, enabling queries, verifications, and dependency tracking without relying on external repositories. Located in the/var/lib/rpm/ directory, it maintains an on-disk structure that catalogs package metadata and file associations to ensure system integrity and facilitate management operations.[50][51]
The database employs either SQLite as the default backend—introduced in RPM 4.16 with Fedora 33 in 2020 for improved maintainability and crash recovery—or the legacy Berkeley DB format, depending on the distribution and configuration. Since RPM 4.16.0, an additional native database (ndb) backend is also available as a modern alternative to SQLite and Berkeley DB for enhanced stability.[52][53] Its core contents include package headers storing essential metadata such as name, version, release, architecture, and summary; comprehensive file lists that enumerate every installed file with attributes like paths, sizes, permissions, and checksums; capabilities defining inter-package relationships through provides, requires, conflicts, and obsoletes tags for dependency resolution; and transaction history via install transaction IDs (Installtid) that log sequences of installations, upgrades, and removals.[54]
Key operations interact directly with this database: the rpm --query (or rpm -q) command retrieves details on installed packages, supporting formats like --list for file listings, --provides for capabilities, or --changelog for version history, allowing targeted searches such as rpm -q --whatprovides /path/to/file.[50][55] For integrity checks, rpm --verify (or rpm -V) scans files against database records, flagging discrepancies in checksums, modes, or ownership, with options like --nofiles to focus on package-level verification or -a for all packages. Maintenance tasks include rpm --rebuilddb, which reconstructs indices from stored headers to repair corruption, often invoked as rpm --rebuilddb -v for verbose output during recovery.[56][50]
When handling upgrades or removals, the database dynamically updates entries: upgrades overwrite old headers and adjust file lists while preserving transaction continuity, and removals erase records to prevent orphaned references, all within atomic transactions to maintain consistency. Backups are achieved by copying the entire /var/lib/rpm/ directory prior to changes, or using backend-specific tools such as db_dump for Berkeley DB files or sqlite3 rpmdb.sqlite .dump for SQLite to export the schema and data.[51][57][53]
In environments with large-scale deployments—such as servers managing thousands of packages—the database can encounter scalability challenges, including extended rebuild durations on systems with a large number of entries and query slowdowns due to index fragmentation, exacerbated by the unmaintained Berkeley DB's concurrency limitations. Optimization strategies include regular vacuuming for SQLite (sqlite3 rpmdb.sqlite VACUUM), pre-compiling SQL statements in custom tools for repeated queries, and monitoring lock contention via rpmdb_stat; the SQLite migration enhances overall robustness but may require tuning for high-concurrency writes in enterprise settings.[52][58][59]
Repository Handling
In RPM-based systems, repositories are configured through INI-style .repo files, typically located in the/etc/yum.repos.d/ directory (or equivalent for other front-ends like Zypper), by higher-level package managers such as DNF and Yum that use the RPM database for local operations. These files specify essential parameters such as the baseurl (a direct URL to the repository) or mirrorlist (a URL listing multiple mirror servers), along with gpgkey (the URL or path to the repository's GPG public key for signature verification), and other options like enabled=1 to activate the repository and gpgcheck=1 to enforce metadata and package signature validation.[60][61]
The core of a repository's structure lies in its repodata directory, which contains compressed XML files generated to describe available packages without requiring individual downloads. Key files include primary.xml.gz, which provides package metadata such as names, versions, summaries, and dependencies; filelists.xml.gz, detailing the files contained within each package; and otherrepodata.xml.gz for supplementary information like changelogs. This metadata format, known as repomd, enables efficient querying and dependency resolution by client tools.[62][63]
On the server side, tools like createrepo_c generate and update this repodata from a directory of RPM packages, ensuring synchronization between package additions or changes and the metadata index. Clients such as DNF or YUM cache this metadata locally in /var/cache/dnf or /var/cache/yum after downloading it, with synchronization achieved via commands like dnf makecache to refresh expired or outdated caches, preventing stale data during operations.[64][65]
The update process involves the package manager parsing repository metadata to compare available package versions—using epoch, version, and release (EVR) tuples—against those in the local RPM database, identifying and queuing downloads for newer or updated packages. Where supported, such as in older Fedora releases, delta RPMs (drpms) allow downloading only the differences between old and new package versions to reduce bandwidth, though this feature has been deprecated in recent distributions due to maintenance overhead.[66][67]
For systems with multiple repositories, mirror lists in .repo files provide redundancy by allowing clients to select from a list of synchronized servers, often using metalink files for automatic fastest-mirror selection or random failover. Priority handling, configurable via the built-in DNF priorities or the yum-plugin-priorities, assigns numerical values (lower numbers indicating higher priority) to repositories, ensuring packages from preferred sources are chosen first and preventing conflicts from lower-priority mirrors.[68]
Security in repository handling emphasizes HTTPS for encrypted transport, enforced by setting baseurl to https:// and enabling sslverify=1 in .repo files or global configuration to validate server certificates. GPG keys for trusted repositories are imported using rpm --import followed by the key URL or file, allowing verification of signed metadata and packages to detect tampering; repositories without valid keys prompt users during initial access.[69][61]
Tools and Interfaces
Command-Line Operations
The RPM command-line tool provides essential operations for managing packages on systems using the RPM Package Manager, including installation, upgrading, removal, querying, verification, and building from specifications. These operations are performed directly via therpm and rpmbuild executables, allowing precise control over package handling without higher-level abstractions.[70][71]
Installation of a new package is achieved using the -i or --install option, which places the package contents into the filesystem and updates the local database; for example, rpm -i example-package.rpm installs the specified file. Upgrading or replacing an existing package employs the -U or --upgrade option, which removes any prior versions before installing the new one, as in rpm -U example-package.rpm. Freshening, via -F or --freshen, upgrades only if an older version is already present. Erasure removes an installed package with -e or --erase, such as rpm -e example-package, and supports options like --nodeps to bypass dependency checks or --test to simulate the action without changes. These modes also accept --justdb to update only the database entry, useful for repairs.[70]
Query operations begin with -q or --query to inspect installed packages or files. Listing installed packages uses rpm -q package-name, while detailed information like version, description, and dependencies is retrieved via rpm -qi package-name. File listings within a package are obtained with rpm -ql package-name, and ownership of a specific file is determined by rpm -qf /path/to/file. Additional query formats include --changelog for release notes and --provides for capabilities offered by the package. These queries interact with the underlying installation database for accurate results.[70]
Building packages from a SPEC file utilizes the rpmbuild command, which executes defined stages such as %prep (unpacking sources and applying patches), %build (compiling), %install (placing files into a build root), %check (running tests), and %files (assembling the archive). The -bb or binary build mode produces only the binary RPM, as in rpmbuild -bb example.spec, while -ba generates both source and binary RPMs. Options like --clean remove the temporary build tree after completion, --nodeps skips dependency verification during assembly, and --test (via related checks like -bl for file lists) simulates without execution.[71]
Verification ensures package integrity using -V or --verify, which compares installed files against the original metadata for attributes like size, permissions, and checksums; rpm -V package-name targets a specific package, or rpm -Va verifies all. Flags such as --nofiles omit file checks and --nodeps ignores dependencies. Transaction sets enable atomic operations across multiple packages, initiated implicitly in multi-file commands or via scripting with options like --test for dry runs, facilitating safe integration into automation scripts.[70]