How install RPM packages on Ubuntu using Alien

Overview

In this tutorial, you will learn how to install RPM packages on Ubuntu using a package named alien.

Ubuntu is a Debian based Linux distribution, and as such it uses deb packages for installing software. However, not all not all software is packaged in the deb format. Some software maintainers only provide an RPM package, which is a format used exclusively with Red Hat and CentOS based distributions.

Thankfully, a Debian package named Alien allows us to natively install RPM packages on Ubuntu. The package is available for Ubuntu 16.04, Ubuntu 18.04, Ubuntu 19.10, and Ubuntu 20.04.

Installing Alien

As Alien is available from Ubuntu’s package repository, it is very simple to install. To install it, use the following command.

sudo apt-get install alien

Converting RPM to Deb

For an RPM to be installed on Ubuntu it must be converted to a Deb package, which is what Alien does for us. We simply point Alien at our RPM file and it will do the hardwork.

alien <package>.rpm

Alien will output a new deb file from the RPM, which will need to be installed using native Ubuntu or Debian tools.

Installing a Deb Package on Ubuntu

Once the RPM file has been converted to a Deb package, we can install it using native tools. For installing deb packages, you use the dpkg command.

dpkg -i <package>.deb

Install RPM packages on Ubuntu with Alien

The examples above required two steps before an RPM could be installed. You first needed to convert the package into Ubuntu’s native package format, and then install it using the dpkg command.

However, Alien can convert and install all in one step. To do so you use the -i flag.

sudo alien -i <package>.rpm

Conclusion

Alien is handy utility for converting between different package formats. In this tutorial, you learned how to convert an RPM into a Deb file and install it. You also learned how to install an RPM file directly, without having to convert it first.

While we only covered RPM to Deb conversion in this tutorial, alien is capable of doing more. It also able to perform the inverse, where we convert a Deb file into an RPM file.