How to install/remove/upgrade .rpm packages on Red Hat?

EDIT: As recommended in a comment below, you can just use yum for everything and you will be fine.

Check Red Hat's documentation for the rpm command.

Basically:

  • rpm -Uvh package_file.rpm installs/upgrades a package from a .rpm file
  • rpm -e package_name removes a package

To install packages from Red Hat's repositories, use yum, whose commands are mostly self-explanatory (install, update etc...). This documentation is for CentOS 5, but I think it should work for newer versions of Red Hat/CentOS.


RTFM: man yum. apropos install leads to the rights track.

If "apropos" does not return anything, you have to run makewhatis first.

After that you will find almost anything with "apropos" which will do a full-text-search of all man-page-short-descriptions.

yum, as opposed to rpm, will resolve all dependencies needed.


Install Rpm

rpm -ivh abcd.rpm

Update rpm

rpm -Uvh abcdef.rpm

remove rpm

rpm -e abcd.rpm 

or remove the the rpm without deps

rpm -e --nodeps abcd.rpm