How to install an .rpm from the terminal

Installing a .rpm package from the terminal is a little different than installing a similar package as .deb in a different distro.

There are a few different commands, all of which start with “rpm”. This command will install a package:

$ sudo rpm -ivh packagename.rpm

This will “upgrade” a package:

$ sudo rpm -Uvh packagename.rpm

And if you want to find out what dependencies an .rpm has, you can run this against your .rpm:

$ sudo rpm -qpR packagename.rpm

It’s fairly easy and not complicated, but it’s still a question I see / hear a lot.