Introduction
RPM is a package format used by Red Hat-based derivatives like Rocky Linux, CentOS, RHEL, or Fedora. The name comes from the RPM Package Manager (RPM), a free and open-source package management system for installing, uninstalling, and managing software packages in Linux.
In this tutorial, you will learn how to install .rpm packages on Ubuntu.
Prerequisites
- A user account with root privileges.
- Access to the terminal (Ctrl + Alt + T).
- A working internet connection.
Convert and Install an RPM Package on Ubuntu
This section shows the steps for converting an .rpm package to a .deb package and then installing it. However, note that when you convert an .rpm package to install it on Ubuntu, you may encounter dependency and compatibility issues. An issue may happen because the package manager is unable to resolve the software dependencies properly and because the package was not originally intended for a Debian system.
Depending on which software you want to install and the dependencies it requires, you can manually resolve the dependencies by installing the required packages separately using Ubuntu's apt package manager.
Follow the steps below to convert and install RPM packages using the alien utility.
Note: Learn the difference between apt and snap, two package managers for Ubuntu.
Step 1: Install Alien Package
Alien is a useful tool that facilitates conversions between Red Hat rpm, Debian deb, Stampede slp, Slackware tsz, and Solaris pkg file formats. Follow the steps below to install alien:
1. Update your package repository information to get the latest program version:
sudo apt update
2. Install the alien conversion utility using the command below:
sudo apt install alien -y
Wait for the process to finish.
Step 2: Convert .rpm Files to .deb Format
After installing the alien utility, you can convert .rpm files to the .deb format. Follow the steps below:
1. Download the .rpm package for the software you want to install. Make sure to use a trusted source for your download.
2. Open the terminal and use the cd command to move to the directory where you saved the .rpm file.
3. Use the syntax below to convert the RPM file and install it:
sudo alien [package_name].rpm
Replace [package_name]
with the full name of the package you want to convert. You can list the contents of the directory with the ls command and copy the package name for the command above. For example:
The command instructs alien to initiate the process of converting the .rpm file to a .deb file. Wait for the process to complete.
Note: You need to log in as a user with sudo access to install packages on Ubuntu.
Step 3: Install the converted .rpm package on Ubuntu
Once the conversion has run its course, use the following syntax to install the .deb package:
sudo dpkg -i [package_name].deb
Replace [package_name]
with the actual name of the converted package. For example:
You have now successfully installed a converted .rpm file on Ubuntu.
Install .rpm Package Directly on Ubuntu
You can also directly install .rpm packages on Ubuntu without previously converting them. However, you need to have installed the alien tool mentioned in the previous section.
Warning: This command can lead to serious compatibility issues if you attempt to run it with important system packages since RPM was not developed for Debian-based distributions.
The syntax for installing .rpm packages directly is:
sudo alien -i [package_name].rpm
For example:
The command installs the package on your system.
Conclusion
By following the tutorial, you can install an RPM package on Ubuntu. However, be aware that installing packages that were not originally meant for your system can cause compatibility issues, especially if you are updating essential system packages. In that case, a better option would be to use Ubuntu repositories or adequate alternative packages.
Next, check out our tutorial for crucial Linux commands and download a cheat sheet, or see how to install and use winget, a Linux-style Windows package manager.