RPM Package Manager is a package management system.
The name RPM variously refers to the .rpm file format, files in this format, software
packaged in such files, and the package manager itself.
RPM was intended primarily for Linux distributions; the file format is the baseline package format
of the Linux Standard Base.
Even though it was created for use in Red Hat Linux, RPM is now used in many GNU/Linux
distributions.
It has also been ported to some other operating systems, such as Novell NetWare and IBM's
AIX.
Whereas an RPM typically contains the compiled version of the software, an SRPM contains
either the source code corresponding to that RPM or the scripts of a non-compiled software
package.
History RPM was originally written in 1997 by Erik
Troan and Marc Ewing, based on pms, rpp, and pm experiences.
pm was written by Rik Faith and Doug Hoffman in May 1995 for Red Hat Software.
The design and implementation of pm was influenced greatly by previous experience with pms(1),
a Package Management System designed and implemented by Rik 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
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.
Features of RPM include: RPM packages can be cryptographically verified
with GPG and MD5 Original source archive(s) are included in
SRPMs, making verification easier PatchRPMs and DeltaRPMs, the RPM equivalent
of a patch file, can incrementally update RPM-installed software
Automatic build-time dependency evaluation.
Local operations Packages may come from within a particular
distribution or be built for it by other parties.
Circular dependencies among mutually dependent RPMs can be problematic; 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 local site often has its own local 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: yum used in Fedora, CentOS 5, Red Hat Enterprise
Linux 5 and above, Scientific Linux, Yellow Dog Linux and Oracle Linux
up2date used in Red Hat Enterprise Linux, CentOS, and Oracle Linux
Zypper used in MeeGo, openSUSE and SUSE Linux Enterprise
urpmi used in Mandriva Linux, Rosa Linux and Mageia
apt-rpm, a port of Debian's Advanced Packaging Tool used in Ark Linux, PCLinuxOS and ALT
Linux Smart Package Manager, used in Unity Linux,
available for many distributions including Fedora.
rpmquery, a command-line utility available in Red Hat Enterprise Linux
Local RPM installation database Working behind the scenes of the package manager
is the RPM database, stored in lib/rpm.
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 installs a package, thus enabling the user to reverse the changes and remove the
package later.
If the database gets corrupted, the index databases can be recreated with the rpm --rebuilddb
command.
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
in the format: --..rpm
such as: libgnomeuimm-2.0-2.0.0-3.i386.rpm
where is libgnomeuimm-2.0.
Source code may also be distributed in RPM packages; the part is specified
as src: libgnomeuimm-2.0-2.0.0-3.src.rpm
RPMs with the noarch.rpm extension refer to packages which do not depend on a certain
computer's architecture.
These include graphics and text for another program to use, and programs written in interpreted
programming languages such as Python programs and shell scripts.
The RPM contents also include a package label, which contains the following pieces of information:
software name software version
package release.
This field is also often used for indicating the specific distribution the package is intended
for by appending strings like "mdv", "mga", "fc4", "rhl9", "suse100" etc.
architecture for which the package was built 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.
Format The format is binary and consists of four
sections: 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, which usually is in cpio format, compressed with gzip.
The rpm2cpio tool enables retrieval of the cpio file without needing to install the RPM
package.More recent versions of RPM can also use bzip2, lzip, lzma, or xz compression.
RPM 5.0 format supports using xar for archiving.
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 may contain only scripts that are architecture-independent.
In such a case only an SRPM may be available; this is still an installable RPM.
Forks As of June 2010, 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
and 4.10 in May 2012.
This version is used by distributions such as Fedora, Red Hat Enterprise Linux, SUSE's
openSUSE and SUSE Linux Enterprise, CentOS, Mageia, and formerly Mandriva.
RPM v5 The RPM maintainer since 1999, Jeff Johnson,
continued development efforts together with participants from several other distributions.
RPM version 5 was released in May 2007.
This version is used by distributions such as Unity Linux, Wind River Linux, Rosa Linux,
and OpenMandriva Lx and also by the OpenPKG project which provides packages for other
common UNIX-platforms.
See also
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 Linux distributions Portage — package management system used
by Gentoo Ports and Packages — FreeBSD's package management
system Ports and Packages — OpenBSD and NetBSD
package management system pkg-config — queries libraries to compile
software from its source code MANCOOSI
pkgsrc — package management system focusing on NetBSD, but available for Solaris, Linux,
Darwin, FreeBSD, OpenBSD, IRIX, BSD/OS, AIX, Interix, DragonFlyBSD, OSF/1, HP-UX, QNX,
and Haiku References
External links Red Hat RPM Guide from the Fedora project.
RPM.org project home page RPM5 Package Manager homepage
RPM and DPKG command reference The story of RPM by Matt Frye in Red Hat Magazine
Advanced RPM query strings Video tutorials for Building and Patching
the RPMs RPM Notes - Building RPMs the easy way
Packaging software with RPM, Part 1: Building and distributing packages
Learn Linux, 101: RPM and YUM package management