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:

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:

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.

Share this page:

Suggested articles

3 Comment(s)

Add comment

Comments

By: com enter

sorry to dampen the parade, but;

Yum command has been deprecated, redirecting to '/usr/bin/dnf '.

See 'man dnf' and 'man yum2dnf' for more information.

To transfer transaction metadata from yum to DNF, run:

'dnf install python-dnf-plugins-extras-migrate && dnf-2 migrate'

 

You need to give some command

usage: dnf [options] COMMAND

 

List of Main Commands

 

autoremove                

check-update              Check for available package upgrades

clean                     Remove cached data

distro-sync               Synchronise installed packages to the latest available versions

downgrade                 downgrade a package

group                     Display, or use, the groups information

help                      Display a helpful usage message

history                   Display, or use, the transaction history

info                      Display details about a package or group of packages

install                   Install a package or packages on your system

list                      List a package or groups of packages

makecache                 Generate the metadata cache

mark                      Mark or unmark installed packages as installed by user.

provides                  Find what package provides the given value

reinstall                 reinstall a package

remove                    Remove a package or packages from your system

repolist                  Display the configured software repositories

repository-packages       Run commands on top of all packages in given repository

search                    Search package details for the given string

updateinfo                Display advisories about packages

upgrade                   Upgrade a package or packages on your system

upgrade-to                Upgrade a package on your system to the specified version

 

List of Plugin Commands

 

builddep                  Install build dependencies for package or spec file

config-manager            manage dnf configuration options and repositories

copr                      Interact with Copr repositories.

debug-dump                dump information about installed rpm packages to file

debug-restore             restore packages recorded in debug-dump file

debuginfo-install         install debuginfo packages

download                  Download package to current directory

langavailable             Search available langpack packages

langinfo                  Show langpack packages for a given language

langinstall               Install the given packages

langlist                  Show installed languages

langremove                Remove the given packages

leaves                    List installed packages not required by any other package

needs-restarting          determine updated binaries that need restarting

playground                Interact with Playground repository.

repomanage                Manage a directory of rpm packages

repoquery                 search for packages matching keyword

reposync                  download all packages from remote repo

system-upgrade            Prepare system for upgrade to a new release

tracer                    

 

By: Pyrotelekinetic

From what I've seen, dnf works exactly the same as yum.

By: musasji

running this tool gave me this: "Package build failed. Here's the log of the command (cd everdo-1.4.1; rpmbuild --buildroot='/home/giovanni/Downloads/GTD/Everdo/Everdo.Ubuntu/everdo-1.4.1' -bb --target x86_64 'everdo-1.4.1-1.spec'): error: line 5: Empty tag: Summary:" So tinkering a bit to fill in some text in the Summary tag, it the rpmbuild can proceed. The resulting rpm: works like a breeze :-)