Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to linux, and at the university we are using this distribution to mount servers on VM, but I need to install a package that is missing in my virtual machine that is running Red Hat, but how to do that, what command should I use to install/remove/upgrade .rpm packages.

share|improve this question
up vote 6 down vote accepted

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.


  • 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.

share|improve this answer
As this page of the RHEL6 Deployment Guide explains, you should only use rpm if absolutely necessary -- under normal circumstances, there's no reason to use the above-mentioned rpm commands to play with the package database; yum install package_file.rpm and yum remove package_name will do just fine. – rsaw Jul 15 '12 at 19:37
@ryran sweet, I didn't know that (haven't used rpm-based distros in quite a while). Edited my answer to reflect that. – Renan Jul 15 '12 at 20:24

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.

share|improve this answer
For the record, apropos only searches the names and short descriptions of man pages, in contrast to what you describe. man -K on the other hand... – rsaw Jul 16 '12 at 0:21
@ryran thanks - I corrected it. On CentOS 5 man -k does the same as apropos, according to the man-page and to a test. – Nils Jul 17 '12 at 15:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.