How to Install rpm Package in CentOS with yum install command

In this tutorial we are going to learn how to install rpm Packages in CentOS 7 Linux using yum install command.

Traditionally the rpm command used to install rpm Packages in CentOS Linux. But the better way is to use yum command to install rpm files because when you install rpm package using yum command, it will automatically install all the dependency packages needs by the original package. With rpm command, we have to install all dependency packages manually one by one.

To install rpm package, use yum install command followed by the name of the rpm file you want to install.

yum install filename.rpm

If you do not specify the absolute path to the rpm file, yum command will look for the .rpm file in the current working directory or you can specify the absolute path to the .rpm file.

yum install /home/user/Download/filename.rpm

Example - yum command to install rpm packages in CentOS 7

For example, If I want to install teamviewer on CentOS 7, First, I download the teamviewer rpm installer, then install the rpm package with yum command.

yum install teamviewer_10.0.36281.i686.rpm

How to Install rpm Package in CentOS with yum install command

Same way, if you want to install google chrome on CentOS 7, First download the rpm package, then use yum command to install rpm package on Linux CentOS.

yum install google-chrome-stable_current_x86_64.rpm

So, that is how we can use yum command to install rpm packages in CentOS 7. You can use yum install command to install rpm packages on any RedHat Based Linux distribution, Including RHEL 7, Fedora and Oracle Linux.