How to Install RPM Packages on Ubuntu

Rpm is a package manager used by Red Hat- based derivatives like CentOS, RHEL. For instance, Debian based derivatives use DEB as the package manager. Similarly, Red Hat-based derivatives use RPM as a package manager.

But as its quite easy to install DEB packages in Ubuntu, the same is not the case with RPM files in ubuntu. As most DEB packages have a standard ubuntu repository. And when standard repositories are not available deb can be easily installed from appropriate sources.

But in certain rare cases when the software package is only available as an RPM package. Then you just can’t directly download that software package through repositories on Ubuntu. In such cases, there are ways to port these packages to use on Ubuntu. So just follow this tutorial to install the RPM package on Ubuntu

Converting RPM packages into DEB using Alien

Alien is a very useful tool that can convert packages between Red Hat rpm, Debian deb, Stampede slp, Solaris pkg, and Slackware tsz formats. So to convert RPM files into DEB we will use Alien here.

Note: We do not recommend installing RPM packages on Ubuntu unless there is a option. As it can lead to package dependency conflicts.

Step 1: Add the Universe Repository

Before installing the alien, we will need to add a software repository called Universe. To add this repository open terminal and type the command below.

sudo add-apt-repository universe

Step 2: Update Repositories

Now you need to update repositories to utilize the newly added repository.

sudo apt-get update

Step 3: Install Alien package

Now as we have installed Universe repository lets install Alien by the following command.

sudo apt install alien

The above command will also install the necessary build tools.

Step 4: Converting .rpm files into .deb

Now as we have installed Alien, its time to convert the .rpm files into .deb. To do this go to the folder where the rpm file located and open a terminal there. Or you can also use cd command in the terminal to navigate to the RPM file’s location.

When in that directory just type the command below to start the conversion.

sudo alien packagename.rpm

Depending on the size of the package it might take some time. When the package gets successfully converted you will see the output as follows:

packagename.deb generated

Now just install deb package simply using the command below or you can also refer to this guide.

sudo dpkg -i packagename.deb

You now have successfully installed rpm package on Ubuntu.

Install an RPM package on Ubuntu directly

Instead of converting and installing the package you can also use this command to directly install the RPM package. Just enter the command following command in step 4.

sudo alien -i packagename.rpm

Here -i will tell alien to directly install the RPM package.

In this tutorial, we learned how to install RPM packages on Ubuntu. If you have any question feel free to ask in comments we would love to help you. If you love the tutorial do share it with your friends.

Leave a Reply

Share via
Copy link
Powered by Social Snap