|
Interrogatory: Hi, Pablo! Great blog, you are the best in the world, I love you. I have a question to ask you: I have a DEB package that I would like to install on my Fedora. Is it possible to convert a DEB package to RPM (and vice versa)?
Answer: Thanks for the compliments, in the little free time I have I try to share my knowledge about the Linux world because I want to help spread the word and, also, because I believe in the philosophy that Linux represents (Stallman dixit). Regarding the conversion, of course you can. You just have to install the program alien. |
Convert RPM to DEB
1.- Install alien. On Debian and derivatives, this would look like this:
sudo apt-get install alien
2.- Now, it only remains to use alien to perform the conversion.
alien mypackage.rpm
Ready! You can now install the DEB package created using the command dpkg or simply by double clicking on it.
Convert DEB to RPM
To convert to RPM you must use the -r option.
sudo alien -r mypackage.deb
Ready! You can now install the RPM package created using the command rpm on your Fedora, CentOs, etc.
Convert to SLP, LSB, Slackware TGZ
Alien also allows you to convert packages to the formats used in other distros: Stampede slp, LSB and Slackware tgz.
To see the available options, run:
alien -h
So you can take a look, the output of that command is as follows:
Usage: alien [options] file [...] file [...] Package file or files to convert.
-d, --to-deb Generate a Debian deb package (default).
Enable these options:
--patch = Specify patch file to use instead of automatically
looking for patch in / var / lib / alien.
--nopatch Do not use patches.
--anypatch Use even old version os patches.
-s, --single Like --generate, but do not create .orig
directory.
--fixperms Munge / fix permissions and owners.
--test Test generated packages with lintian.
-r, --to-rpm Generate a Red Hat rpm package.
--to-slp Generate a Stampede slp package.
-l, --to-lsb Generate a LSB package.
-t, --to-tgz Generate a Slackware tgz package.
Enable these options:
--description = Specify package description.
--version = Specify package version.
-p, --to-pkg Generate a Solaris pkg package.
-i, --install Install generated package.
-g, --generate Generate build tree, but do not build package.
-c, --scripts Include scripts in package.
-v, --verbose Display each command alien runs.
--veryverbose Be verbose, and also display output of run commands.
-k, --keep-version Do not change version of generated package.
--bump = number Increment package version by this number.
-h, --help Display this help message.
-V, --version Display alien's version number.
Thanks to Favio Tapia Velasquez for suggesting the topic!