03-12-2012, 05:16 PM
Red Hat Package Manager (RPM)
Red Hat Package Manager.doc (Size: 86 KB / Downloads: 24)
What is RPM?
RPM Package Manager (RPM) 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 GNU/Linux distributions; the file format is the baseline package format of the Linux Standard Base.
Originally developed by Ethan "E$" Cohen at Red Hat for Red Hat Linux, RPM is now used by many GNU/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. When we use RPM for installing the software package, RPM checks if our system is suitable for the software the RPM package contains, figures out where to install the files the package provides, installs them on our system, and adds that piece of software into its database of installed RPM packages.
Where as 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.Originally standing for Red Hat Package Manager, RPM now stands for "RPM Package Manager", a recursive acronym.
rpm is a powerful Package Manager, which can be used to build, install, query, verify, update, and erase individual software packages. A package consists of an archive of files and meta-data used to install and erase the archive files. The meta-data includes helper scripts, file attributes, and descriptive information about the package. Packages come in two varieties: binary packages, used to encapsulate software to be installed, and source packages, containing the source code and recipe necessary to produce binary packages.
Mode of the RPM:-
Query, verify, signature check, install/upgrade/freshen, uninstall, initialize database, rebuild database, resign, add signature, set owners/groups, show querytags, and show configuration.
Installing RPM packages:-
Suppose we want to learn Lisp, and a colleague tells we to use the gcl command. we might try gcl --help, or we might try which gcl, or type gcl. But if our system can't find gcl, we might see output similar to that shown in below-
Package locations:-
In the previous section, we learned how to install an RPM package. But where do the packages come from? How does yum know where to download packages from? The starting point is the /etc/yum.repos.d/ directory, which usually contains several repo files. This is the default location for repos, but other locations may be specified in the YUM configuration file, normally /etc/yum.conf. The fedora-updates.repo corresponding to the location from which we installed gcl on our Fedora system.
A typical repo file is divided into three sections, one for normal
packages, one for debug packages, and the last for source packages. Usually there will be several copies of a distribution's packages available from different locations, or mirrors. So the repo file tells yum where to find the latest list of mirrors for each section. Note that the distribution release level and machine architecture are parameterized, so yum would download the list for my x86_64 Fedora 12 system from In addition to the repository location, the repo file tells whether a particular repository is enabled and whether GPG signatures should be used to check the downloaded packages.
YUM and RPM use a local database to determine what packages are installed. The metadata about packages that is stored in the local database is retrieved from the enabled repositories. Although you will seldom need to worry about the local database, you use the command yum clean to clean out various parts of the locally stored information and yum makecache to create the information in your local database for the enabled repos. We might do this if we change our repo configuration, for example.
Back to top
Removing RPM packages:-
If we want to remove a package, can use the remove option of yum, or the -e option of rpm. A test run to remove gcl usingrpm -e is shown in Listing 5. If the package can be removed, there is no output.