Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

How to remove installed package using RPM?

Answer:

To remove installed package using rpm, use the following command

e.g. remove Firefox

rpm -e firefox

To remove multiple packages, try

rpm -e firefox gedit

How to extract RPM package without installing it

Answer:

Assume you have foo.rpm, type the following command to extract the rpm's contents

rpm2cpio foo.rpm | cpio -idmv

How to check if a rpm package is already installed?

Answer:

To query if a package is installed, e.g.

rpm -q httpd

To display package information, e.g.

rpm -qi httpd

How to upgrade an installed RPM package

Answer:

To upgrade an installed RPM package under Red Hat/Fedora/CentOS

# rpm –Uvh package.rpm

How to install a RPM package

Answer:

To install a RPM package under Red Hat/Fedora/CentOS

# rpm –ivh package.rpm