Redhat Package Manager (RPM)
-
What is an RPM?
RPM is also called as the Red Hat Package Management system. This is an freely published set of specifications and tools to allow Linux and Unix vendors to package their software in a way that is amenable to automated installation upgrade, removable and administration. Although it has Red Hat's name in it —- it has been adopted by most of the major Linux distribution maintainers.
-
Basic Concepts of RPM
The RPM Package Manager (RPM) is a powerful command line driven package management system capable of installing, uninstalling, verifying, querying, and updating computer software packages. Each software package consists of an archive of files along with information about the package like its version, a description, and the like.
An RPM package will be of the form
<name>-<version>-<release>.<arch>.rpm
-
Different Modes of Usage
Installation:
In the simplest form to install a package (foo version 1.2 in this example), you can use commands like:
rpm -i foo-1.2.rpm
rpm –ivh foo-1.2.rpm
Upgrading:
Suppose you have the package foo-1.2 installed. If you have the newer version of that package (say foo-1.3), then you can upgrade the package. This is how its done.
rpm -U foo-1.3.rpm
rpm –Uvh foo-e.1.2.rpm
Removing:
Suppose you have the package foo-1.2 installed. If you have this package.
rpm -e foo-1.3.rpm
Quering:
You can query a list of files from an installed package with
rpm -ql $SOME_INSTALLED_PACKAGE
list all of the packages that you have installed on the whole system
rpm -qa
You can also find out which package a given file "belongs to" with a command like:
rpm -qf /some/file/that/was/installed/by/something
You can search the installed package
rpm -qa | grep –i installed package name
To roll back the RPM transaction, use the —rollback option followed by the rollback target. If an hour after upgrading foo, you decide you don't want it, you could type:
rpm -Uvh --rollback '2 hours ago'
rpm -Uhv –-rollback ‘9:00 am’
rpm -Uhv –-rollback ‘december 25′