RPM-based distributions are great. They offer a different way of doing things compared to Debian-based ones. Still, if you’re using one, you’ll no doubt be aware of its single greatest weakness – package availability. RPMs are just not as abundant as DEB files. It’s a fact.
Some users have combated this in a few ways: the OpenSUSE build service or by using repositories like RPMFusion. For the most part, this helps close the gap. However, sometimes this just doesn’t cut it. Sometimes you still need a package, and you can’t find it anywhere.
Sure, you can always find the source of the program you want to install and compile it on your own, but sometimes that’s just not going to happen, especially for proprietary programs. Most of the time those kind of programs are only released with binary packages, so compiling them is out of the question.
How do we solve this issue? Simple. Just convert the package files to the format you need using Alien. It allows you to take one package of one format and convert it to another format. For the most part, doing this works. Most of the time packages get converted and can be installed with no problem. Other times their are errors. Try this at your own risk.
How to convert DEB files to RPM
Before we begin, you’ll need Alien. Check your distro’s repository. It may be in there. If not, get it here. You’ll need to look for the package specific to your operating system.
Once you’ve got it downloaded, install it and then open a terminal window.
Find the Deb package you’d like to convert and download it to your PC. Once you’ve got it downloaded, go back to the terminal you opened previously. Then, just enter the command below.
You’ll notice that in the command above, there’s more than one switch. Most people, when using alien to convert DEB to RPM, only use the
-r switch. It’s not enough. This switch only tells the program to convert the package. If you add the
-v switch to the command, things will go a lot smoother (most of the time).
-c switch will include all of the scripts that may or may not be inside the package. Most of the time, you’ll want to use this switch. It will help with converting packages better. Sometimes packages don’t come with scripts included, or just don’t work with the
-c switch. In this case, just don’t use it. Do some experimentation.
There’s another switch that most people won’t use either. It’s
-v. What does it do? It’ll display each and every command that Alien runs during the conversion. This will allow you to troubleshoot the conversion process.
Once you run the command, if successful, your new RPM file will be created, and after which, you’ll be able to take it and install it to your system. It’ll be located in the exact same place that the DEB file is. The RPM file will have the exact same name too.
Alien is a very useful program. It helps close the massive gap that has been plaguing Redhat-based distributions for a very long time. Perhaps one day the time will come when developers recognize RPMs just as much a DEBs. Until then, this program will always serve a purpose.
Our latest tutorials delivered straight to your inbox