RPM Package Manager

From Wikipedia, the free encyclopedia

RPM Package Manager
OS Linux, Unix-like
Genre Package management
License GNU General Public License
Website http://rpm.org/

RPM Package Manager (originally Red Hat Package Manager, abbreviated RPM) is a package management system.[1] The name RPM refers to two things: a software package file format, and software packaged in this format. RPM was intended primarily for Linux distributions; the file format RPM is the baseline package format of the Linux Standard Base.

Originally developed by Red Hat for Red Hat Linux, RPM is now used by many Linux distributions. It has also been ported to some other operating systems, such as Novell NetWare (as of version 6.5 SP3) and IBM's AIX as of version 4.

"RPM Package Manager" as it is used today is an example of a redundant acronym.

Contents

[edit] The RPM database

Working behind the scenes of the package manager is the RPM database, stored in /var/lib/rpm. It consists of a single database (Packages) containing all of the meta information of the installed rpms and multiple databases used for indexing purposes. 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.[2]

[edit] Package label

Every RPM package has a package label, which contains the following pieces of information:

  • the software name
  • the software version (the version taken from original "upstream" source of the software)
  • the 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), "fc4" (Fedora Core 4), "rhl9" (Red Hat Linux 9), "suse100" (SUSE Linux 10.0) etc.
  • the architecture the package was built for (i386, i686, athlon, ppc, etc.)

RPM file names normally have the following format:

<name>-<version>-<release>.<arch>.rpm

An example:

nano-0.98-2.i386.rpm

A package label is contained within the file and does not necessarily need to match the name of the file. Source code may also be distributed in RPM packages. Such package labels do not have an architecture part and replace it with "src". E.g.:

libgnomeuimm2.0-2.0.0-3.src.rpm

Additionally, libraries are distributed in two separate packages for each version. One contains the precompiled code, while the second one contains the development files such as headers, static library files, etc. for the library in question. Those packages have "-devel" appended to their name field. Users need to carefully check so that the version of the development package matches that of the binary package, otherwise the library may not work very well.

RPM files with the noarch.rpm extension refer to files which do not depend on a certain computer's architecture. These files usually include graphics and text for another program to use, and sometimes programs written in an interpreted programming language, such as Python programs and shell scripts.

[edit] Advantages and disadvantages of the format

RPM packages have many often-cited advantages over other package management systems:

  • They present a uniform way for the user to install programs.[clarify]
  • Uninstalling programs is simple.[citation needed]
  • It is popular: the typical rpm repository[clarify] contains thousands of free applications.
  • Non-interactive installation makes it easy to automate.
  • Original source archive (e.g. .tar.gz, .tar.bz2) are included in SRPMs, making verification easier.[clarify]
  • Packages can be cryptographically verified with GPG and MD5.
  • DeltaRPMs, the RPM equivalent of a patch file, can incrementally update RPM-installed software without needing the original package.

RPM has also been criticized for a lack of consistency in package names and content (termed 'dependency hell') which can make automatic dependency handling difficult. However, this is not a problem inherent in the RPM format, but rather because of differing packaging guidelines among major Linux distributions that use RPM in packaging such as Fedora, SUSE, and Mandriva Linux. When using packages that are from a particular distribution (say Red Hat Linux) or built for a particular distribution (for example Freshrpms for Fedora),[3] tools such as urpmi, yum or apt can perform automatic dependency checking.

[edit] 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.

[edit] Physical package format

The package is a binary format and consists of four sections:[1]

  • The lead 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 contains metadata including package name, version, architecture, file list, etc..
  • A file archive, which usually is cpio compressed with gzip. In more recent versions of RPM star can also be used for archive and bzip2 or lzma for compression. RPM 5.0 format supports using xar for archiving.

[edit] RPM-based Linux distributions

See also: List of Linux distributions#RPM-based

Several Linux distributions are based on RPM. These include, but are not limited to:

[edit] Front ends

There are several front ends to RPM that resolve dependencies.

The best-known ones are:

[edit] Controversy

As of the 31 May 2007, 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. Both projects currently call themselves the "official" version of RPM.

[edit] RPM v4

The rpm.org community's RPM is hosted by Duke University, and the majority of content is maintained in the wiki. The maintainer of RPM is Red Hat developer Panu Matilainen. RPM.org issued its first major code revision in July 2007, and the latest version 4.4.2.2 was released on 3 October 2007. Its version is used by Fedora, Red Hat Enterprise Linux, Novell's OpenSUSE, Mandriva and CentOS. Panu Matilainen is also the current maintainer of apt-rpm.

[edit] RPM v5

The RPM maintainer since 1999, Jeff Johnson, continued his development efforts after leaving Red Hat. Johnson combined with the efforts of OpenPKG in May 2007 to produce RPM version 5. This version is used by distributions like PLD and supported by OpenPKG. This code base has also been ported to many platforms, including BSD, Linux, Solaris and Mac OS X Unix flavors, as well as Microsoft Windows via Cygwin. Additionally, the code base was heavily cleaned up, and now can be compiled with all major C compiler suites, including GNU GCC, Sun Studio and Intel C/C++.

Changes and new features include:

  • RPM packages, in addition to the default Gzip and optional Bzip2 compression, now also support LZMA compression
  • initial support for the XML Archive (XAR) file format has been added, where the implementation establishes a wrapper archive format for mapping the four sections used in RPM format packages (Lead, Signature, Header and Payload) to files with the same name in a XAR format package.
  • support for the old RPMv3 LSB package format was removed to cleanup and simplify the code base. RPM 5, with respect to RPM format packages, now supports RPMv4 format only.
  • features for use in package specifications (.spec files) were added, including new standard and even custom tags, new standard sections, etc.
  • RPM is now able to automatically track vendor distribution files with its new vcheck(1) based "%track" section, and now can automatically download the vendor distribution files, too.[4]

The displaced former RPM website content is archived by its long-time maintainer at the oldrpm web archive.[5] On 2006-12-14 Red Hat decided to take complete control of editorial content at the formerly community-maintained website, at which content was maintained in a manner "open to the community."

[edit] See also

  • Autopackage - a "complementary" package management system
  • dpkg - package management system used by Debian
  • Portage - package management system used by Gentoo
  • pkg-config - queries libraries to compile software from its source code

[edit] References

[edit] External links