How to install an rpm file on CentOS

On extremely rare occasions (LOL) we get precompiled binaires we can install on our Linux systems. Depending on the distributions, we may end up with an rpm file. I always forget how to install them when this happens – probably it happens so very rarely.

Here’s how we can do that.

Installing rpm files with yum

Yum can deal with both local and remote precompiled rpm files. For files already on our system, we can call this:

yum localinstall yourfile.rpm

Instead of a local filename, we can also pass a URL like so:

yum localinstall https://server.com/yourfile.rpm

Using RPM itself

RPM is a slightly scary low-level tool that can also install rpm files. YUm actually uses this under the hood. It’s a little less user friendly, which yum aims to alleviate. Here’s how it works with RPM:

rpm -i yourfile.rpm

The -i switch is for “install”. We can also specify a more verbose output with

rpm -ivh yourfile.rpm

with the -v and -h standing got “verbose” and “human readable” I believe. Other switches include -U for “update” and -e for “erase”. Case sensitivity is important here.

Further Reading

You can leave a comment on my original post.