Home Ubuntu How to install RPM packages on Ubuntu

How to install RPM packages on Ubuntu

install rpm packages ubuntu

The Ubuntu version of Linux has thousands of deb packages that can be installed from the official Ubuntu software center or by using the apt command line utility. Deb is an installation package format used by all Debian-based distros, including Ubuntu. However, some packages are not available in the standard Ubuntu repo, but they can easily be installed by enabling the appropriate source.

Generally, when the software vendor does not offer a repo, they will have a download page from which you can download and compile or set up the deb package software from sources. Not so regularly, some software may be provided only as an RPM package. RPM, in this case, is just another package format used mainly by Red Hat and its derivatives like CentOS. As such, they are installing such an application requires some tweaks and tricks to get it done. Luckily, an alien tool permits us to set up an RPM file on Ubuntu or convert an RMP file into a Debian package file. Practically, anything from one Linux distribution can be done on another with a change in approach.

So this guide will compile for you the best approaches to installing an RPM file on the main operating system and ensure compatibility with this type of package, among all other Debian distros. There are techniques to port these packages to different versions of Linux, like Ubuntu. So installing RPM packages on Ubuntu is a pretty easy task if you stick with us until the end of this guide.

Installing RPM packages on Ubuntu

Here are some prerequisites we need to get started.

  • Linux Ubuntu version.
  • A non-root sudo user.
  • Alien tool.
  • Terminal access.
  • The RPM file needs to be converted.
  • Internet connectivity.

There are two good ways to install an RPM package on our Ubuntu Linux; the first is by converting the .rpm file into a .deb file, and the other is by installing the .rpm file directly. The two methods are worth trying so that you can be in a position to pick the best for yourself. The two approaches are relatively simple, but installing RPM packages on a Debian-based system can lead to some issues, depending on the software being set up, so be keen.

Let’s get going!

Method 1: Convert the RPM file into a .deb file

As earlier said, .rpm files need converting to .deb files for stability.

As such, we must install the “Alien” software package that translates .rmp files into .deb files. To set up the Alien software, we must first append a ” Universe ” software repo to our system. This can be attained by executing the following command:

sudo add-apt-repository universe
add universe repository

Add universe repository

Now that that is done, we have to update our system cache list so that we can use the just-installed repository:

sudo apt-get update
update system

Update system

In case you find packages that need to be upgraded after running the update command, then run the following command:

sudo apt upgrade
upgrade system

Upgrade system

Note: While upgrading the system, you may be prompted to confirm if you want to continue with upgrading your system. Just type in “y/Y” and hit the “Enter” button on your PC, and the process will continue.

After updating the system, it is now time to set up the alien tool by running either of the following commands:

sudo apt-get install alien
install alien first approach

Install the Alien first approach

Or

sudo apt install alien -y
install alien second approach

Install Alien second approach

Any of the two-given commands above will give you the correct output. However, for the first command, you must affirm your decision to install the alien software on your Ubuntu system. In contrast, the second command with the -y tag will automatically install the software without requesting you to affirm anything.

Now that we have the alien software installed on our system, we will have to pick one RPM file that we will install for demonstration. In our event, we downloaded Firefox.rpm file.

After downloading the file, you must navigate to the downloaded file location. In our case, we will navigate to the Downloads folder as it is where our downloads are directed to:

cd Downloads
go to downloads

Go to Downloads

In the above snapshot, you should locate a .rpm file. Let’s now use the alien tool we installed to convert our RPM file to DEB. This follows the following syntax:

sudo alien <name of package>.rpm

Where:

sudo alien firefox-107.0-4.fc38.x86_64.rpm
alien command

Alien Command

Note: In our instance, we used Firefox.rpm file, which may not be the same in your case. All you have to do is change the file name to yours and run it, as the steps remain the same.

Once that is done and dusted, the system will show the following message that plainly defines that the RPM package has successfully been converted into a deb package:

Successfully converted

Successfully converted

If you list all the files in the Downloads directory, you should see the .deb file created as shown below:

list files

List files

Remember that converting the file may take a while. Once it is converted, you can install the file using the dpkg. Substantially, Dpkg is the tool at the base of the package management system in the free operating system Debian and its derivatives. It installs, removes, and provides info about .deb packages. The installation command will follow this syntax:

sudo dpkg -i <name of package>.deb

Where:

sudo dpkg -i firefox_107.0-5_amd64.deb
successfully installed

Successfully installed

Installing these files is the same as installing a standard .deb file package; if you have once done so, it should sound familiar. But if you haven’t, there is no need to panic, as the methods are user-friendly as covered. After that, you can start using the installed software as you usually would:

file installed

File installed

You can see we have two firefox apps. That is because we had one installed before we installed another one using the .rpm file.

Let us focus on how we can use the RPM package directly on our Ubuntu system.

Method 2: Install the RPM package directly on Ubuntu

In this section, we will set up the .rpm package in our Ubuntu system without converting it to a .deb file format, as we did in the guide’s first section.

Here, we will also use the alien software. We can install the RPM packages directly via this program. The instructions below are for setting up an RPM package from the terminal window.

And be warned that this command can cause serious compatibility issues with critical system packages. This is because RPM wasn’t originally for Debian-based distributions.

Here is the syntax to do so:

sudo alien -i <name of package>.rpm

Where:

sudo alien -i firefox-107.0-4.fc38.x86_64.rpm
directly install an rpm file

Directly install an RPM file

You have now directly set up an RPM package on your Ubuntu system without any conversion process. But remember that installing packages in formats that are not native to Ubuntu can pose a significant risk to your system.

Is it worth installing RPM packages in Ubuntu?

It’s a yes and no. By this, we mean installing packages designed for a particular operating system is best. What performs or works best on Ubuntu is downloaded software from the official apt repos and 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 systems.

A couple of the RPM packages are available as a DEB package or in the official Ubuntu repos so it would be foolish and a complete waste of your precious time to convert a package to a format in which it already exists. But the fact remains that there are DevOps who only release their software in one type, and we can always find software for Linux that is only in RPM and not any other format.

In a nutshell, everything in life has to follow an order, and that order (presently) in Ubuntu, in our honest opinion, must be:

  • Ubuntu default repos (or the system we are using).
  • Third-party repos, that is, that of the developer of the software.
  • Snap packages, since they are from Canonical and support is included by default.
  • Flatpak packages, because of their popularity and since they can be integrated into Ubuntu and its software center.
  • AppImage, if you download them from known sources.
  • The rest, among which are the RPM packages.

Final Thoughts

You should be rest assured that you will not make a mistake if you keenly heed the above-covered instructions as they are. This guide has described how we can set up the packages. We have explained the two methods and covered them to the core. In case of anything, don’t hesitate to reach us via the comment section below; Otherwise, keep following FOSSLinux for more Linux tips and hints.

You may also like

Leave a Comment

fl_logo_v3_footer

FOSS Linux is a leading resource for Linux enthusiasts and professionals alike. With a focus on providing the best Linux tutorials, open-source apps, news, and reviews, FOSS Linux is the go-to source for all things Linux. 


Whether you’re a beginner or an experienced user, FOSS Linux has something for everyone.

Follow Us

Subscribe

©2016-2023 FOSS LINUX

A PART OF VIBRANT LEAF MEDIA COMPANY

ALL RIGHTS RESERVED.

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.