Ask Your Question
0

How to convert .rpm package to .deb?

asked 2014-08-15 21:06:27 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I want to create rpm package from a .deb package. Please let me know about any easy method to do it. I am new to packaging.

edit retag flag offensive close merge delete

Comments

Off topic: I like Gnovi, the physics OS, are you the maintainer?

abadrinath gravatar imageabadrinath ( 2014-08-15 23:05:11 -0500 )edit
1

In which direction to you want to convert? The title says RPM → Debian, the text says Debian → RPM.

Martin Ueding gravatar imageMartin Ueding ( 2015-05-26 04:24:51 -0500 )edit

2 Answers

Sort by » oldest newest most voted
2

answered 2014-08-19 17:41:00 -0500

davidva gravatar image

updated 2014-08-19 17:42:36 -0500

You need learn how to compile a program, is not difficult, if you provides me the source code, I can help you. But you need learn no?

3 ways

1) The correctly way

You need learn how to compile, and read the official guide here

2) Funny way

You can use fpm; read about fpm here

su -c 'yum -y install ruby-devel binutils dpkg-devel rpm-build libffi'

gem install fpm

If you have a debian package is very simple:

mkdir /tmp/installdir
cp -f myprogram.deb  /tmp/installdir
cd /tmp/installdir
ar vx mypackage.deb
tar -xzvf data.tar.gz
rm -f control.tar.gz data.tar.gz debian-binary

The line using fpm, magic no?

You need change to name you want, and the version "1.1" to ??; also your name; email, url and license, no delete the quotes. Also you need write a simple description (change the example). and finally write all dependencies; example the next line I need java then -d 'java >= 6' , you can put all necessary. Remember no delete the quotes!

fpm -s dir -t rpm -p myprogram-VERSION_ARCH.rpm -n myprogram -v 1.1 -m "Juan Camaney <juancamaney at gmail dot com>" --license "GPLv3" --url http://miprogram.edu --description "My program is..." -d 'java >= 6' -C /tmp/installdir usr/

3) Alien way

It can cause problems, I broke my system by installing an rpm, I created with alien...

su -c 'yum -y install alien fakeroot'
fakeroot alien -r myprogram.deb
edit flag offensive delete link more

Comments

Thanks a lot davidva. I need to learn all the se things. I will try these things today and will get back to you if I need help. :)

gnovi gravatar imagegnovi ( 2014-08-19 20:53:07 -0500 )edit

@gnovi no problem! In the dependencies you must compare the equivalent in Fedora; then I recommend check dependencies with 'yum whatprovides' or my favorite site http://pkgs.org/

davidva gravatar imagedavidva ( 2014-08-19 21:37:18 -0500 )edit
2

answered 2014-08-15 21:18:46 -0500

abadrinath gravatar image

Using alien

You can use alien for this purpose. Install using:

# yum install alien

For help learning alien, visit

# man alien

or,

# alien --help

To convert deb to rpm, use

# sudo alien -r file.deb

The output will be:

file.rpm generated

Alternatives

In cases of errors, the deb file is probably corrupt or unusable. On the other hand, sometimes, alien cannot handle the deb file. In that case,

# ar vx mypackage.deb

then,

# tar -xzvf data.tar.gz

For a listing of the files,

# tar -tzvf data.tar.gz

After extracting the files,

# yum install fedora-packager

Follow the instructions here to build your rpm:

https://fedoraproject.org/wiki/How_to_create_an_RPM_package

HTH.

edit flag offensive delete link more

Comments

1

I'd highly suggest to NOT use alien: I've seen that it can mix up file/directory permissions which could render Fedora unbootable. I don't know if it is in active development and if the problems are fixed, but be careful in using it!

hedayat gravatar imagehedayat ( 2014-08-16 01:47:12 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-08-15 21:06:27 -0500

Seen: 10,054 times

Last updated: Aug 19 '14