Install RPM Packages in Ubuntu (If You Really Need to)

In desperate need of installing an application that is only available in RPM package? Here's how you may convert RPM to DEB file.
Warp Terminal

In Linux, there are a multitude of package formats and package managers.

Ubuntu and other Debian-based distributions use DEB packages, while Red Hat, Fedora-based distros use RPM packages.

When downloading an application, you'll often see both DEB and RPM options.

In some rare cases, you'll find that an application is only available in RPM format. And if that's the case and you are desperate to use the application in Ubuntu or Debian, there is still a shot worth trying.

You can try converting the RPM package to DEB file using Alien tool and then install this deb file. Indirectly, you are installing RPM file on Ubuntu.

🚧

This is very experimental and not every RPM converted to DEB can be installed on Ubuntu. You may get lucky but be prepared to get disappointed as well.

Before you convert RPM to DEB

Converting an RPM package to DEB should be your last resort. Do the following beforehand.

  • Make sure that the application is not available in DEB format. Check if there is a PPA you could use.
  • Check if the application in question is available in Snap, Flatpak or AppImage format. If yes, use that instead.
  • See if you can use an alternative application for the same purpose. Your purpose usually should be to get the end result, not get the end result with XYZ tool only.

Once you have done that and found that you got no other option left, then only you go ahead and use to convert RPM to DEB.

Install Alien

Alien is a small utility that allows you to convert between various package formats.

By various, I mean, it can convert RPM to DEB, to Solaris PKG, TGZ packages and vice versa.

You need to install it first:

sudo apt install alien

Now that you have installed it, let's go and convert some RPM files.

🚧

While converting from other formats to Deb, you should keep in mind to avoid important system packages like libc, init system packages etc. Since these packages are created based on distribution, replacing it with an alien may result in catastrophic effects. Also, you should not install alien for those packages that may cause system break if removed.

Create a DEB File from RPM

For the purpose of this tutorial, I am using an RPM file of WeekToDo, an open source To Do application.

If you are converting an RPM or any other package to Deb, you need to install some dependencies, using the command given below (some are pre-installed in Ubuntu and Debian):

sudo apt install gcc make debhelper dpkg-dev dpkg

Once it is installed, run the following command to convert RPM to DEB:

sudo alien --to-deb <path-to-RPM-file>

Or you can omit the --to-deb as this is the default.

sudo alien <path-to-RPM-file>
Creating a DEB file from RPM file using "alien" command
Creating DEB file from RPM

You can now install the Deb file using any of the usual method.

sudo apt install <path-to-deb-file>

Install an RPM file directly

If you want to skip the intermediate step of creating a deb file and want to install the RPM file directly, run:

sudo alien -i <path-to-RPM-file>

This will install the respective RPM file after converting and removes the package file, after installed.

Install RPM package diectly in Ubuntu, without first saving converted DEB file.
Install RPM package directly

Keep the same version number

Alien, during conversion, adds one to the minor version number. This can be avoided, if you want, by specifying the option -k or --keep-version.

sudo alien -k <Path-to-RPM-file>

Try to convert the scripts

Sometimes, you may need to convert the scripts meant to be run when the package is installed and removed. To do so, run:

sudo alien --scripts <path-to-RPM-file>

Or,

sudo alien -c <path-to-RPM-file>

You should use this with utmost caution. Because the scripts might be designed to work on a system unlike your own, and this will result in various issues that may be hard to solve.

Also, you should examine the scripts by yourself and verify no issues may arise from it, once converted.

πŸ’‘

You can use the same alien too to convert DEB files to RPM.

Other Useful Options

Command Uses
sudo alien --to-rpm 'path-to-deb-file' Converts the given deb file to rpm. You need rpm installed for this purpose.
-h Help
--verbose Display all the commands executed by alien, during the process
--veryverbose Display all the commands, along with their outputs, executed by alien during the process

You can refer to its man page for more details about the program, like applying patches, testing etc.

About the author
Sreenath

Sreenath

Linux tinkerer by day, Lord of the Rings fanatic by night. When I'm not busy conquering the command line, you can find me kicking back and watching some football while quoting JRR Tolkien

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.