Science Fair Project Encyclopedia
RPM Package Manager
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.
| Contents |
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.
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 "mdk" (Mandrakelinux), "FC3" (Fedora Core 3), "rh9" (Red Hat Linux 9), "SuSELinux90" (SuSE Linux 9.0) etc.
- the architecture the package was built under (i386, i686, athlon, ppc, etc.)
and the RPM file would normally have the following format:
<name>-<version>-<release>.<arch>.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-3.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.
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.
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 urpmi, and can help with the so called 'dependency hell'.
Related tools
RPM is often used by another tool for handling dependencies, such as the Yellow dog Updater Modified yum or (the RPM compatible version of) the Advanced Packaging Tool (apt).
Some other package managers are
- dpkg used with Advanced Packaging Tool (apt) in Debian Linux
- emerge used in Gentoo Linux
- urpmi used in mandrakelinux
See also: Archive formats
External references and links
- Eric Foster-Johnson, 2003, Red Hat RPM Guide. ISBN 0764549650. A complete, up to date (as of 2003) guide for building RPM packages.
- Fox, Pennington, Red Hat 2003: Fedora Project Developer's Guide: Chapter 4. Building RPM Packages
- RPM man page
- RPM Package Manager homepage
- RPM Building as a User
- Bailey, Ed 2000: Maximum RPM, an outdated but popular rpm reference
- Package File Format - Linux Standards Base
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details


