Install Software Packages for RPM-Based Distributions


rpm -ihv [package]
rpm -Uhv [package]

The rpm command installs software installers that end in .rpm, which seems entirely logical. To install an RPM package, you need to download it first. Let's use the industry-standard open-source network port scanner nmap as the example. You can download the RPM package for nmap from www.insecure.org/nmap/download.html; after it's on your system, you simply run rpm along with three options: -i (for install), -h (to show hash marks so you can watch the progress of the install), and -v (be verbose and tell me what you're doing). The command, which must be run as root, would look like this:

# rpm -ihv nmap-4.01-1.i386.rpm 


This is actually not the command you should run, however. A better choice is -Uhv, where -U stands for upgrade. Why is -U better than -i? Because -i only installs, while -U upgrades and installs. If a package already exists on your system and you're trying to put a newer one on your machine, -U performs an upgrade; if a package doesn't already exist on your system, -U notices that and instead installs it. Therefore, just use -U all the time, and it won't matter if you're upgrading or installing: -U does what needs to be done, and you won't need to worry about it.

# rpm -Uhv nmap-4.01-1.i386.rpm Preparing... ############################## [100%]    1:nmap    ############################## [100%] 


If you want to install more than one RPM, just list them separated by spaces, one after the other:

# rpm -Uhv nmap-4.01-1.i386.rpm nmap-frontend-4.01- 1.i386.rpm 


You can also use wildcards if you have many RPMs to install. For instance, if you have 20 .rpm files in a subdirectory named software, just run this command to install them all:

# rpm -Uhv software/*.rpm 


Caution

The -U option is always better, except when installing a kernel. Then you want to use -i instead. If you upgrade with -U and the new kernel doesn't work, you're in a world of hurt. On the other hand, if you install a new kernel with -i, the old one is still on your machine as a backup if the new one blows up.




Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net