Science  People  Locations  Timeline
Index: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Home > RPM Package Manager


 Contents
RPM Package Manager (or RPM, originally called "Red Hat Package Manager") is a package management system primarily intended for Linux. RPM installs, updates, uninstalls, verifies and queries software. 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 NetWare by Novell.

1 The RPM database

Working behind the scenes of package manager is the RPM database. It consists of a doubly linked list that contains all information for all installed RPMs. The database keeps track of all files that are changed and created when a user installs a program and can therefore very easily remove the same files. If the database gets corrupted (which happens easily if the RPM client is killed), the double links ensure that it can often be rebuilt without any trouble. On RedHat systems the database is stored in /var/lib/rpm.

2 Package label

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

and the RPM file would normally have the following format:

--..rpm

An example:

nano-0.98-2.i386.rpm

However, note that 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 obviously do not have a architecture part and replaces it with "src". I.e:

libgnomeuimm2.0-2.0.0-3mdk.src.rpm

Additionally, libraries are distributed in two separate packages for each version. One containing the precompiled code and one containing the development files such as header 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 very well not work.

3 Usage

RPM Package Manager contains one command line tool called rpm with which packages can be installed, uninstalled and queried. Here are some examples on how to use it:

rpm -i xmms-1.2.7-21-p.i386.rpm

Installs XMMS on the system. Root access is needed.

rpm -U xmms-1.2.7-27.i386.rpm

Upgrades XMMS on the system. Note rpm -U works exactly equal to rpm -i if the package is not yet installed.

rpm -qa

Prints out all installed packages.

rpm -qi xmms

Display package information, including name, version, and description.

rpm -qpi xmms-1.2.7-27.i386.rpm

Works exactly the same as -qi, except that -qpi has a filename as parameter, and not the package name.

rpm --version

Prints RPM version.

rpm --rebuilddb

Rebuilds the RPM database. Very useful command if the database gets corrupted. Note that on some versions of rpm the program will not explicitly state that the database is corrupted and will just hang when rpm is invoked.

rpm -e xmms

Removes XMMS from the system. Root access is needed.

4 Advantages and disadvantages of the format

Advantages of using RPM packages over other ways to acquire and install software often cited are:

  • A uniform way for the user to install programs.
  • Much simpler to uninstall programs.
  • Popularity: lot of packages available, even though they often need recompilation to work in another distribution.
  • Non-interactive installation: makes it easy to automate installation.
  • Original source archive (e.g. .tar.gz, .tar.bz2) included: easy to verify.
  • Cryptographic verification with GPG and md5.

Disadvantages often cited include:

  • Often has backwards incompatible changes in package format.
  • Incomplete and outdated documentation.
  • Steep learning curve for packaging.

RPM has also been criticized for a lack of consistency in package names and content, which can make automatic dependency handling difficult. However, this is not a problem unique to the RPM format, but rather a problem in co-ordination amongst major distributions who use RPM in packaging such as Red Hat, SuSE and Mandrake Linux. When using packages that are from a particular distribution (say Red Hat) or built for a particular distribution (for example Freshrpms [1] for Red Hat), then automatic dependency checking can work, using tools such as apt adapted from the Debian project (see below). A tool exclusively for Mandrakelinux is urpmiurpmi is a Mandrake Linux package management tool for installing, removing, updating and querying software packages of local or remote (networked) media. It wraps around the package manager rpm with the aim that the user should not have to suffer the ofte, and can help with the so called ' dependency hellDependency hell occurs in package-based operating systems particularly Linux and is a colloquial term for the frustration of many users who have installed software packages which have dependencies on specific versions of other packages. This version infor'.



Read more »