Installing RPM packages in Ubuntu
Before you begin:
This is not the recommended method for installing software packages in Ubuntu. If possible, preferably install software from the Ubuntu repositories.
Not all RPM packages can be installed on Ubuntu. Installing packaged RPMs on Ubuntu may result in package dependency conflicts.
You should never use this method to replace or update critical system packages such as libc, systemd, or other services and libraries that are necessary for your system to function properly. Doing so may result in system installation errors
Install Alien:
Alien is a tool that supports conversion between Red Hat rpm, Debian deb, Stampede slp, Slackware tgz and Solaris pkg.
Before installing the Alien package, make sure that the Universe repository is enabled on your system:
sudo add-apt-repository universe
After the repository is activated, update the package list and install the alien package with the following:
sudo apt update
sudo apt install alien
The above command also installs the necessary build tools.
Convert and install the RPM package:
To convert a package from RPM to DEB format, use the alien command followed by the name of the RPM package:
sudo alien package_name.rpm
Depending on the size of the package, the conversion may take some time. In most cases, you print warning messages on your screen. If the package is successfully converted, the output shows that the DEB package has been generated:
package_name.deb generated
To install the deb package, you can use dpkg or apt:
sudo dpkg -i package_name.deb
sudo apt install ./package_name.deb
Assuming it is compatible with your system and all dependencies are met, the package should now be installed.
Direct installation of RPM package:
Instead of converting and then installing the package, you can use the -i option, which tells Alien to install the RPM package directly.
sudo alien -i package_name.rpm
The above command will automatically generate and install the package and after installation, remove the package.