Ubuntu uses ‘.deb’ packages for installing applications on system & RPM is the default package manager for RHEL/CentOS. But can we install RPM packages on Ubuntu? YES, we can.
But should we, well that depends on your necessity. Almost all the application/packages available for RHEL are available for Ubuntu but even then if you want to install RPM packages on Ubuntu systems, please follow the tutorial.
To install RPM packages on Ubuntu, we need to install a tool called ‘alien’. Alien allows us to convert the ‘.rpm’ packages into ‘.deb’ packages which can then be installed on Ubuntu systems or without converting, alien can also directly install ‘.rpm’ packages onto Ubuntu systems. We will explore both the methods, so let’s first start with the installation of the alien.
Recommended Read: Package management in Ubuntu : Learn dpkg command with examples
Alien packages are available with a repository named ‘Universe’. So to add the repo, execute the following command from the terminal,
$ sudo add-apt-repository universe
Once that is done, we can install alien with the following command,
$ sudo apt-get update && sudo apt-get install alien
This command also install build tools, but just in case also run the following command to make sure that all tools are installed,
$ sudo apt-get install dpkg-dev debhelper build-essential
Now we are ready to next part i.e. installation/conversion on ‘.rpm’ packages.
Converting RPM package into DEB package
So first we will discuss the conversion of rpm to deb. To do this, execute the following command from terminal,
$ sudo alien package.rpm
The conversion process will then start & depending on the package size will be completed. Once the conversion is complete, we will be greeted with a message saying ‘package.deb generated’ on the terminal screen.
Note:- During conversion, we might also see some warning messages but most of them require no attention.
Now that we have a deb package, we can simply install it with the following command,
$ sudo dpkg -i package.deb
So depending on the fact that all dependencies are met, the package will install.
Installing RPM without conversion
With alien, it is also possible to install ‘.rpm’ package directly without the need for converting it to deb package first. Run the following command,
$ sudo alien -i package.rpm
Technically this command is first converting the package to deb & then installing it, so this command is a single command for conversion & installation.
With this we end our tutorial on how to install RPM packages on Ubuntu, please feel free to share your thoughts/questions using the comment box below.