How to convert packages between .deb and .rpm

How to convert packages between .deb and .rpm

How to convert packages between .deb and .rpm

Unfortunately, and after years of development in every part of the free software that we enjoy, there are still two primary types of software package available in GNU/Linux systems. The one is the .deb type which is used by Debian and Debian-based distributions like Ubuntu, Mint, and Elementary, and the other is the .rpm type which is used by Fedora, openSUSE, Mageia, and CentOS. As it is only natural, this causes confusion to users who search for the right package, and requires additional effort from software publishers and distributors. It is often the case that we find a software tool in rpm form when we would need a deb file, or vice versa. Fortunately, there’s a workaround for this as we can try to transform the one type to the other. Here’s how:if(typeof __ez_fad_position != ‘undefined’){__ez_fad_position(‘div-gpt-ad-howtoforge_com-box-3-0’)};

The conversion tool that we will need is called “alien” and you can install it on Ubuntu by opening a terminal and running the following command:if(typeof __ez_fad_position != ‘undefined’){__ez_fad_position(‘div-gpt-ad-howtoforge_com-medrectangle-3-0’)};

sudo apt-get install alien

If you’re using Fedora or CentOS, you can install alien with:

yum install alien

Debian users can do this through:

apt-get install alien

Now let’s suppose that I want to convert an .rpm package of the Tomahawk music player to use it on my system. I should navigate to the location of the downloaded package and run the following command:

sudo alien your_package_name.rpm

Convert .rpm to .deb with Alien.

Alien will convert the given file to a .deb type by default. The parameter for this type is “-d”. If you want to do the opposite, you will have to use the “-r” parameter after the “alien” command. You may also convert to a “pkg” software package type by using the “-p” parameter, or to a “tgz” one (Slack) with “-t”.

Note that the version number in the resulting package is bumped by default. You can avoid this automatic change by inserting the “-k” parameter that will keep the version number the same as the original package.

sudo alien -k your_package_name.rpm

You can even use the alien command to install the converted right away by including the “-i” parameter in the command. That would be ”sudo alien -d -i -k your_package_name.rpm”. This would convert the package into a .deb type, keep the current version number, and install the resulting file in your system.

About the Author

Leave a Reply