August 6, 2008

Ubuntu : How to install RPM packages in ubuntu

If you have an rpm file for a package you wish to install, and if you cannot find a .deb debian package.You can use alien package converter to install your rpm file in ubuntu.

The alien site describes it this way :

"Alien is a program that converts between the rpm, dpkg, stampede slp, and slackware tgz file formats. If you want to use a package from another distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it."

Installing Alien

Installing alen is an easy task with Ubuntu

$sudo apt-get install alien

This command will get and install the alien from ubuntu depositaries, sometimes you might need to run the apt-get update command before executing the above command.

How to convert a .rpm file to .deb file

To install the .rpm file, you first need to convert it to the debian package (.deb) file.Only debian packages can be installed in Ubuntu directly.

Assume that we have our rpm package with name name-of-rpm-file.rpm. You can convert it using the following commands.

$sudo alien -k name-of-rpm-file.rpm

This command will convert the .rpm to a .deb.

- The “-k” will keep the version number. Otherwise alien adds a “1″ to the version number.

Now everything is ready, and the debian package is available in the directory.

How to install the debian package

We have the converted file in our directory.Now we can install the package using the newly generated debian package (.deb file).To install the debian package you just need to type

$sudo dpkg -i name-of-deb-file.deb

in your terminal window.

Hope this works for you.Fore more information and help on alien, just have a glance at the man page or drop a comment here.

No comments: