How to convert .deb packages to .rpm packages and vice versa

Two mostly used Linux distributions are Ubuntu and the other, Fedora. Ubuntu uses .deb packages for installation while Fedora uses packages with .rpm extension. Problem arises when a person using Fedora gets a .deb package or when a person who uses Ubuntu gets a .rpm package. Here's a simple way to convert them between .rpm and .deb. The solution is the 'alien' command. If you don't have it, use

sudo apt-get install alien

will install alien on to your Ubuntu machine.

Now to convert rpm to debian use

alien rpm-package.rpm

where rpm-package.rpm is your rpm file. A .deb file with same name will be created.

And to convert .deb to .rpm use

alien -r deb-package.deb

where deb-package.deb is your .deb file. A .rpm file with the same name but .rpm extension will be generated.

The same command can be used to convert many other formats. To know more just use the man pages of your Ubuntu machine.