The Red Hat package management system (rpm) is a user-friendly (yet robust), standardized installation application that makes installing, uninstalling, verifying, and querying programs easy, while retaining the strength and efficiency of Linux.
Like many Linux commands and applications, rpm accepts arguments and flags, which adds to its useful nature. These arguments, like many Linux arguments, dictate to the program (rpm) the nature of the request made, which allows user modification and control.
Let's examine rpm's common uses.
An rpm file (a binary file used for application installation) comes with the extension .rpm and is the Linux equivalent to a Windows .exe file. You can only run rpm as root (super user) from the command line as well as with the GUI tools gnorpm (from the GNOME desktop environment) and kpackage (from the KDE environment). For installation with rpm, a few common arguments are sent to the routine. This is a brief list of the most useful commands for rpm installation:
- · -i: install (install the listed package)
- · -v: verbose (output verbose messages to the screen as the package installs)
- · -h: hash (display hash marks to indicate progress)
There can be many variations of the above arguments. For example, you can install with verbose output only using the -iv combination, or you can upgrade with both verbose information and hash marks using the –Uvh combination. If you need to know which version of a package is installed, you can send the -q argument.
The following command would install this_package-1.1 with verbose output and hash marks indicating the progress of the installation:
rpm -ivh this_package-1.1.rpm
Query with rpm
Once the application is installed, you can check the installation with the argument –q (query) to report the installed package information.
The actual use of the argument is:
rpm -q this_package
Upgrading with rpm
Upgrading with rpm is as simple as installing. In order to upgrade a package you only need to add the argument:
-U: upgrade (upgrade the listed package)
Should you want to upgrade this_package-1.1 to this_package-1.2 run rpm with the upgrade argument like so:
rpm -Uvh this_package-1.2
Upgrading with rpm enables you to extend the verbose and hash arguments as if installing.
And finally, to uninstall this_package run rpm with the following flags:
-e: uninstall (uninstall the listed package)
and the complete command looks like:
rpm -e this_package
There are, in fact, other arguments that you will eventually find a need for. Such arguments include:
The force flag will, quite literally, force the rpm system to install the package, regardless of what may happen. This can come in handy when you need to install a package that's older than the one currently installed.
The nodeps flag will run the rpm without performing a dependency check. Use caution with this flag—if your system fails to meet the minimum requirements for the application, you could end up with a broken application. This argument will come in handy when you attempt to install a package that is met with dependency errors. Such errors include applications that offer configurations for more advanced video libraries (3Dfx for example), but will work with lesser libraries.
The rpm system is a well-designed, fully functional, user-friendly method of managing applications and programs within the Linux environment. The rpm technology is unique to Red Hat Linux, but is used with many other distributions such as Mandrake, Caldera, and SuSE.
Jack Wallen, Jr. is very pleased to have joined the TechRepublic staff as editor in chief of Linux content. Jack was thrown out of the "Window" back in 1995, when he grew tired of the "blue screen of death" and realized that "computing does not equal rebooting." Prior to Jack's headfirst dive into the computer industry, he was a professional actor with film, TV, and Broadway credits. Now, Jack is content with his new position of Linux Evangelist. Ladies and gentlemen—the poster boy for the Linux Generation!The authors and editors have taken care in preparation of the content contained herein, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for any damages. Always have a verified backup before making any changes.
Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.