INSTALL RPM PACKAGE IN CentOS

Red Hat Package Manager (RPM) is a powerful package management system for installing, upgrading, erasing and verifying software packages through command line.

Firstly you need to download the rpm package you want to install from the official project web page. In my case, I need to install java-1.7.0-openjdk with architecture version: x86_64 1:1.7.0.111-2.6.7.2.el6_8

The rpm file was downloaded from here

rpm1

The rpm file name is java-1.7.0-openjdk-1.7.0.111-2.6.7.2.el6_8.x86_64.rpm and is stored in the Downloads folder(Default location).
rpm22
You have to log in as root user in order to install packages using rpm command. If you are a non-root user, use ‘sudo’ before the command.

To install the rpm file,
rpm -ivh <packagename>

Eg:
sudo rpm -ivh /home/cloudera/Downloads/java-1.7.0-openjdk-1.7.0.111-2.6.7.2.el6_8.x86_64.rpm

To upgrade the rpm file,
rpm -Uvh <packagename>

To erase the rpm file,
rpm -ev <packagename>

For more information about rpm, check the rpm man page
man rpm

rpm3

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s