Tuesday, February 3, 2009

Converting .rpm packages to .deb for Ubuntu

If you want to install a package on Ubuntu, but can only find .rpm for it and no .deb then you can use Alien to convert that rpm into a .deb package.
Alien is a computer program that converts between different Linux package formats. It supports conversion between Linux Standard Base, RPM, deb, Stampede (.slp), Solaris (.pkg) and Slackware (.tgz) packages. It is also capable of automatically installing the generated packages, and can try to convert the installation scripts included in the archive as well. The latter feature should be used with caution since Linux distributions may vary significantly from one another, and using install scripts automatically converted from an alien format may break the system.
Alien can be installed from universe repository. You will need to enable it first. After enabling universe repo do:
sudo apt-get update
sudo apt-get install alien
This will install alien. After installing alien you can convert rpm to .deb using command
sudo alien -k package-name.rpm
This will generate a new file named package-name.deb. The -k option is used to keep the version number, otherwise alien will add a 1 to it. Using --scripts option will also include scripts from rpm into .deb.
sudo alien -k --scripts package-name.rpm

No comments: