RPM Package Manager explained

RPM Package Manager (RPM)
RPM Package Manager (RPM)
Author:Erik Troan, Marc Ewing,[1] Red Hat
Developer:Community & Red Hat[2] [3]
Latest Release Version:4.19.1
Programming Language:C, Perl[4]
Operating System:Linux, Unix-like
Language Count:40
Language Footnote:[5]
Genre:Package management system
License:GPL

RPM Package Manager (RPM) (originally Red Hat Package Manager, now a recursive acronym) is a free and open-source package management system.[6] The name RPM refers to the 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

RPM was originally written in 1997 by Erik Troan and Marc Ewing, based on,, and experiences.

was written by Rik Faith and Doug Hoffman in May 1995 for Red Hat Software, its design and implementations were influenced greatly by, a package management system by Faith and Kevin Martin in the fall of 1993 for the Bogus Linux Distribution. preserves the "Pristine Sources + patches" paradigm of, while adding features and eliminating arbitrary limitations present in the implementation. provides greatly enhanced database support for tracking and verifying installed packages.[4] [10] [11]

Features

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:

Local operations

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

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

Several front-ends to RPM ease the process of obtaining and installing RPMs from repositories and help in resolving their dependencies. These include:

Local RPM installation database

Working behind the scenes of the package manager is the RPM database, stored in . It uses Berkeley DB as its back-end. It consists of a single database 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 command.[17]

Description

Whilst the RPM format is the same across different Linux distributions, the detailed conventions and guidelines may vary across them.

Package filename and label

An RPM is delivered in a single file, normally with a filename in the format:

for source packages, or

for binaries.For example, in the package filename, the is, the is, the is, and the is .The associated source package would be named

RPMs with the 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:

The package label fields do not need to match the filename.

Library packaging

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

The format is binary and consists of four sections:[6]

SPEC file

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

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

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

, 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

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, OpenEmbedded, Tizen and OpenMandriva Lx (formerly Mandriva).

RPM v5 (Defunct)

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) and also by the OpenPKG project which provides packages for other common UNIX-platforms.

OpenMandriva Lx has switched back to rpm.org[22] for 4.0 release.

OpenEmbedded, the last major user of RPM5, switched back to rpm.org due to issues in RPM5.[23] [24]

See also

References

External links

Notes and References

  1. Web site: RPM timeline . rpm.org . 2020-06-25.
  2. Web site: RPM -- plans, goals, etc. . Max Spevack . 2011-01-20 . 2012-10-06 . https://web.archive.org/web/20121006213709/https://www.redhat.com/archives/fedora-announce-list/2006-December/msg00003.html . live .
  3. Web site: RPM.org FAQ . https://web.archive.org/web/20161105023930/http://rpm.org/wiki/Docs/RpmOrgFAQ . 2016-11-05 . dead . 2013-08-25.
  4. Book: Bailey , Edward C. . Maximum RPM: Taking the Red Hat Package Manager to the Limit . Chapter 1: An Introduction to Package Management . 22–25 . Red Hat, Inc . 2000 . 978-1888172782 . https://web.archive.org/web/20160910162726/http://rpm.org/max-rpm/s1-intro-to-rpm-package-management-how.html . 2016-09-10 . dead . 2013-08-13.
  5. Web site: po/LINGUAS . GitHub . 2022-04-23 . 2022-04-23 . 2022-04-23 . https://web.archive.org/web/20220423032944/https://github.com/rpm-software-management/rpm/blob/master/po/LINGUAS . live .
  6. Book: Bailey, Edward C.. Maximum RPM: Taking the Red Hat Package Manager to the Limit. Appendix A: Format of the RPM File. 325–336. Red Hat, Inc. 2000. 978-1888172782. https://web.archive.org/web/20160421051859/http://rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format.html. 2016-04-21. dead. 2010-11-22.
  7. Web site: Configuring YUM and creating local repositories on IBM AIX. 2018-10-24. 2020-09-03. 2020-10-03. https://web.archive.org/web/20201003161722/https://developer.ibm.com/technologies/systems/articles/configure-yum-on-aix/. live.
  8. Web site: RPM and Yum are a big deal for IBM i. Here's why. 2018-07-18. 2020-09-03. 2019-06-29. https://web.archive.org/web/20190629155234/https://www.itjungle.com/2018/07/18/rpm-and-yum-are-a-big-deal-for-ibm-i-heres-why/. live.
  9. Web site: Package Manager. 2020-09-04. 2016-03-25. https://web.archive.org/web/20160325005808/https://www.arcanoae.com/wiki/anpm/. live.
  10. Web site: RPM Guide-RPM - Design Goals. 2014-04-14. 2014-03-21. https://web.archive.org/web/20140321202326/http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch01s02.html. dead.
  11. Web site: BOGUS Announce. 2014-04-14. 2013-11-04. https://web.archive.org/web/20131104115129/http://ibiblio.org/pub/historic-linux/distributions/bogus-1.0.1/bogus-1.0.1/notes/Announce. live.
  12. Web site: 2020-01-29 . rpm4 was support for building rpm without Berkeley DB (–disable-bdb) . 2023-09-18 . The FreeBSD Forums . en-US . 2024-02-23 . https://web.archive.org/web/20240223051232/https://forums.freebsd.org/threads/rpm4-was-support-for-building-rpm-without-berkeley-db-disable-bdb.73859/ . live .
  13. Web site: RPM Fusion. rpmfusion.org. 2010-11-22. 2019-02-11. https://web.archive.org/web/20190211131248/https://rpmfusion.org/. live.
  14. Web site: An Analysis of RPM Validation Drift. USENIX Association. 2011-03-15. 2011-07-28. https://web.archive.org/web/20110728150916/http://www.usenix.org/event/lisa02/tech/full_papers/hart/hart.pdf. live.
  15. Web site: Zypper - MeeGo wiki. https://web.archive.org/web/20130925160943/http://wiki.meego.com/Zypper. 2013-09-25. dead. 2014-04-14.
  16. Web site: FAQs: About the Projects . Ark Linux Official Site . 2014-04-14 . dead . https://web.archive.org/web/20120211234858/http://arklinux.org/?q=node%2F53#rpm . 2012-02-11.
  17. Web site: Repair an RPM database safely. https://web.archive.org/web/20190806161221/http://www.oldrpm.org/hintskinks/repairdb/. 2019-08-06. dead. 2011-11-11.
  18. Web site: Supplemental Packaging Software. Fedora Project. 2011-11-11. 2016-03-10. https://web.archive.org/web/20160310171544/https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-extra-packaging-tools.html#id461860. dead.
  19. Web site: Switch RPMs to zstd compression. Fedora Project. Wiki. 2019-06-02. 2019-06-02. https://web.archive.org/web/20190602192906/https://fedoraproject.org/wiki/Changes/Switch_RPMs_to_zstd_compression#Release_Notes. live.
  20. Web site: [PATCH] Add lzip support]. https://web.archive.org/web/20160304023554/http://rpm.org/ticket/839. 2016-03-04. dead. 2013-10-24.
  21. Web site: How to package proprietary software. 10 December 2014. 2018-07-02. 2018-07-02. https://web.archive.org/web/20180702121955/https://developers.redhat.com/blog/2014/12/10/how-to-package-proprietary-software/. live.
  22. Web site: Forum: Switching to RPMv4 . 2018-03-03 . 2022-01-14 . https://web.archive.org/web/20220114075525/https://forum.openmandriva.org/t/switching-to-rpmv4/1702 . live .
  23. Web site: YP Core - Pyro 2.3. Yocto Project. 2017-05-12. 2017-12-04. 2017-12-05. https://web.archive.org/web/20171205042219/https://www.yoctoproject.org/downloads/core/pyro23. bot: unknown.
  24. Web site: [Openembedded-architecture] Changes that switching from smart to dnf will cause]. Yocto Project. 2017-02-14. 2018-11-04. 2018-11-05. https://web.archive.org/web/20181105160511/http://lists.openembedded.org/pipermail/openembedded-architecture/2017-February/000419.html. live.