Monday, May 28, 2012

HowTo: install an rpm package in Ubuntu

 

Overview


Packages in Linux are pre-compiled binaries that can be used to easily install software. Debian and Debian derivative (Ubuntu, Mint) distributions use .deb packages. Redhat and Redhat derivative (Fedora, CentOS) distributions use .rpm packages. Sometimes you need to install a package in Ubuntu, but an rpm package is all that is available. You can convert rpms to debs by using a program called alien.

 

Install alien


In Ubuntu, you can install alien by simply opening up a terminal (ctrl+alt+t) and entering in the following:
sudo apt-get install alien -y

Convert the rpm to a deb


Once the installation has finished, navigate to the directory housing your rpm package while still in the terminal. For example, if you downloaded the rpm to a folder called "downloads" in your home directory, you can get there by entering this:
cd ~/downloads
Now, simply run the alien command with no switches and the rpm package name:
alien packagename.rpm

Install the deb


Once that has finished, you can install the deb using dpkg:
dpkg -i packagename.deb

Notes


You can also use alien to convert deb packages to rpms by running this command:
alien -r packagename.deb

No comments:

Post a Comment