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

Also Read: Working with RPMs: Redhat Package Manager (with examples)



Installing Alien

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,

https://services.vlitag.com/vpaid/?q=9ba3f2539ddb6b2df45a4f25fbfd7843&defaultVolume=&page_url=https://linuxtechlab.com

$ 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.

 

If you think we have helped you or just want to support us, please consider these :-

Connect to us: Facebook | Twitter | Google Plus

Donate us some of your hard earned money: [paypal-donation]

Linux TechLab is thankful for your continued support.