Ubuntu is a popular Linux distribution that is used by end users and enterprises. The RPM package format is a popular Linux packaging format used to manage, install, update and uninstall packages in a Linux system. Ubuntu uses the DEB packages via the apt, dpkg, or apt-get commands which is an alternative to the RPM packaging method. Ubuntu officially supports DEB packages but we can also install the RPM packages by using the alien
command.
Install Alien Package
The alien
is a useful package to convert RPM and DEB packages. It can be easily installed via the apt package manager like below.
$ sudo apt install alien
Install RPM Package with Alien Command Directly
The fastest and most practical way is using the alias command in order to install the RPM package directly into Ubuntu with less stem. Under the hood, the RPM package is converted into the DEB package and installed. Also, keep in mind that installing non-native package formats may cause problems in Linux and Ubuntu systems even if it is very rare.
$ sudo alias -i httpd.rpm
Convert and Install RPM Package to DEB Package
Another way to install RPM package is first converting the RPM package into the DEB package explicitly and then installing it with the dpkg command. We use the alien command to convert RPM package into the DEB package.
$ sudo alias httpd.rpm
Now the converted package is named with the same name but with the *.deb
suffix. We can install the newly converted DEB package with the dpkg
command. Keep in mind that only the suffix is changed and the name of the package stays the same.
$ sudo dpkg -i httpd.deb