Last month, Linus Torvalds said that you would like Linux to be more like Android. Many of you put your hands on your head, until you read that what he was referring to was that on Android we can only install applications in APK format, while on Linux there are many options. DEB packages, Snap, Flatpak, AppImage ... and there are distributions that also use the RPM packages, among which are Red Hat or CentOS.
Can we install RPM packages on Ubuntu? Yes actually, practically anything from one Linux distribution can be done on another. What happens is that, as they are not packages designed for Debian or any of its variants, we must first install a tool called "alien". Technically we will not be installing an RPM package on Ubuntu. What we will do is convert it to DEB to be able to install it on the main operating system of this blog, as well as any other compatible with this type of package, among which are the "father" of all, that is, the aforementioned Debian.
Table of Contents
Convert RPM packages to DEB with Alien
The first thing we will have to do is install Alien. It's in the "universe" repository, so it should be on most Ubuntu-based distributions. The first step may be to try to install the package directly (step 2); if it tells us it doesn't exist, then we add the repository. The steps would be the following
- We add the "universe" repository if we don't have it. Some Live Sessions run without it:
sudo add-apt-repository universe
- Next, we update the repositories and install Alien:
sudo apt update && sudo apt install alien
The above command should install all the necessary dependencies. If this is not the case, we execute this other command:
sudo apt-get install dpkg-dev debhelper build-essential
Install or convert?
- Now we have two options: Install it directly or convert it to DEB.
- To install it directly we will write the following command:
sudo alien -i paquete.rpm
- The conversion is done with the following command:
sudo alien paquete.rpm
In both cases, "package" must be replaced by the package name, which includes the full path to the package. The difference between both commands is that the first converts it to DEB and installs it, while the second only creates a DEB package from the RPM. If we use the second command, then we will have to install it, something we can do by double clicking on it and using our favorite package installation tool, such as the software center.
Is it worth installing RPM packages in Ubuntu?
Well yes and no. By this I mean it is best to install packages that are designed for an operating system. What works best on Ubuntu is software downloaded from official APT repositories and then Canonical's Snap packages. Flatpak packages work fine for the most part, but sometimes they are not as fine as DEB or Snap packages on some operating system.
Many of the RPM packages are available as a DEB package or in the official Ubuntu repositories, so it would be foolish and a waste of time to convert a package to a format in which it already exists. But the truth is that there are developers who only release their software in one type of package, and we can always find software for Linux that is in RPM and not in any other format.
In short, everything in life has to follow an order and that order (currently) in Ubuntu, In my opinion, must be:
- Ubuntu default repositories (or the system we are using).
- Third-party repositories, that is, that of the developer of a software.
- Snap packages, since they are from Canonical and support is included by default.
- Flatpak packages, because of their popularity and because we can integrate them into Ubuntu and its software center.
- AppImage, if we download them from known sources.
- The rest, among which are the RPM packages.
Have you found RPM packages that you would like to install on Ubuntu and now you can thanks to this article?