How to convert DEB to RPM and vice versa

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!


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Anonymous said

    Hello there, I found your blog by way of Google while
    searching for a similar matter, your website got here up, it appears great.

    I've bookmarked it in my google bookmarks.
    Hi there, just was alert to your blog thru Google, and located that it is really informative. I am gonna be careful for brussels. I'll be grateful in case you continue this in future.
    Many other folks will likely be benefited out of your writing.

    Cheers!

    Also visit my website… nicotine juice

  2.   crafty said

    The solution to installing .deb packages on distros with RPM-based package installation.

  3.   Carlos Ochoa said

    Checked…
    I thought it was going to be difficult in MoLinux but nothing to do, everything went fine through the console, I downloaded openproj.rpm and with alien it was all a matter of seconds to have it installed ... »EYE» I had to use the fakeroot command of what otherwise he did not respond.
    Congratulations on the blog, keep it up.

  4.   RADEL said

    Greetings and congratulations on the publication of "How to convert DEB to RPM and vice versa", please kindly attend my request for help in converting and installing tar.gz packages in rpm on Linux Fedora operating system. It should be mentioned that I have already installed the alien converter and making use of this converter first convert the tar.gz package into deb and then convert that deb file into rpm but in the installation I get a message:

    #rpm -Uvh brackets-release-1.6-3.noarch.rpm
    Preparing… ################################## [100%]
    file / from install of brackets-release-1.6-3.noarch conflicts with file from package filesystem-3.2-35.fc23.x86_64

    and from another message # rpm -ivh brackets-release-1.6-3.noarch.rpm
    ################################ [100%]
    file / from install of brackets-release-1.6-3.noarch conflicts with file from package filesystem-3.2-35.fc23.x86_64

    Please again, please be kind enough to help me with this problem of either conversion or installation.

    I thank you in advance for your kind attention, help and prompt response.