You are not logged in.

#1 2014-09-26 17:55:16

helix
Member
Registered: 2013-02-17
Posts: 180

Debtap - A script to convert .deb packages to Arch Linux packages

I wrote this script in my free time to help people who, for any reason, want to convert a .deb to an Arch Linux package. It works in a similar way with alien (which converts .deb packages to .rpm packages and vice versa), but, unlike alien, it is focused on accuracy of conversion, trying to translate Debian/Ubuntu packages names to the correct Arch Linux packages names and store them in the dependencies fields of the .PKGINFO metadata in the final package. In other words, it won't only create an Arch package with the data of the original .deb package, but also it will try to create a valid and as accurate as possible .PKGINFO metadata file in the converted package. It uses pkgfile and pacman utilities to achieve this accuracy. The final package can be installed like any local Arch Linux package. Debtap is now available on AUR!

FAQ

Q: What "debtap" stands for?
A: DEB To Arch (Linux) Package

Q: Isn't better to download an official package or write a PKGBUILD in case I need to compile a package or convert a .deb package to an Arch Linux package?
A: Sure it is, and I truely encourage you to do so. Debtap was written to create packages that either cannot be compiled (closed source packages) or cannot be built from AUR for various reasons (error during compiling or unavailable files), as a quick 'n' dirty solution and an extra option for creating Arch Linux packages for Arch Linux users.

Q: So debtap will help me only in case I need to convert specific .deb packages to Arch Linux packages?
A: No. In case you need to write a new PKGBUILD for a package that already exists in the Debian/Ubuntu distributions, using parameter -p or -P it can generate a PKGBUILD and then edit it as you wish.

Q: What are the minimum requirements to run this script?
A: You need to have installed these dependencies: bash, binutils (provides ar utility for extracting .deb package package and readelf), pkgfile, and fakeroot. You must run at least once (preferably recently) "debtap -u" to create/update pkgfile and debtap database (you do this with root privileges).

Q: Debtap needs a lot of time to convert a package. So, why this is happening?
A: Like I said, debtap is focused on accuracy. It won't just unpack a .deb package and then repackage its data to an Arch Linux package, ignoring metadata. Depending on the speed of your processor and the package itself, conversion can take from a few seconds to several minutes.

Q: During conversion I get several warning messages, why?
A: Debtap cannot be 100% accurate for several reasons,  the main reason for this is the complexity of packages names. If you want to check the freshly generated .PKGINFO and .INSTALL (this is optional file) metadata files or even fix the untranslated packages names inside .PKGINFO, debtap offers you the option to edit these files before compressing the final package.

Q: How do I use debtap?
A: The syntax is quite simple actually: debtap [option] package_filename
For example: debtap world-of-goo-demo_1.0_i386.deb

Any recommendations or questions for debtap are welcomed!

==================

Available options:
    -h  --help            Print help
    -u  --update       Update debtap database
    -q  --quiet          Bypass all questions, except for editing metadata file(s)
    -Q --Quiet         Bypass all questions (not recommended)
    -s  --pseudo      Create a pseudo-64-bit package from a 32-bit .deb package
    -w --wipeout     Wipeout versions from all dependencies, conflicts etc.
    -p  --pkgbuild    Additionally generate a PKGBUILD file
    -P  --Pkgbuild   Generate a PKGBUILD file only
     -v  --version       Print version

Last edited by helix (2020-04-25 19:57:56)

Offline

#2 2014-09-26 18:04:49

progandy
Member
Registered: 2012-05-17
Posts: 5,199

Re: Debtap - A script to convert .deb packages to Arch Linux packages

That's a nice idea. I once had a similar python script, but you had to fix all dependencies manually.

PS: You forgot the link to your script in the  AUR.
https://aur.archlinux.org/packages/debtap
https://github.com/helixarch/debtap

Last edited by progandy (2014-09-26 18:06:57)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#3 2014-09-26 18:06:30

helix
Member
Registered: 2013-02-17
Posts: 180

Re: Debtap - A script to convert .deb packages to Arch Linux packages

You are correct. Thank you!

Offline

#4 2014-09-26 19:51:38

HenriqueNunnes
Member
Registered: 2013-03-29
Posts: 41

Re: Debtap - A script to convert .deb packages to Arch Linux packages

Oh! That's sounds good!

I'll give a try!

Cheers!

Offline

#5 2014-09-27 08:41:22

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: Debtap - A script to convert .deb packages to Arch Linux packages

What a nice script, thanks!

It came in the exact moment when I wanted to install daytasks (todotxt GUI) for which there does no AUR package exist yet.

And it worked like a charme. smile

Offline

#6 2014-10-05 09:41:07

helix
Member
Registered: 2013-02-17
Posts: 180

Re: Debtap - A script to convert .deb packages to Arch Linux packages

I just uploaded into AUR debtap-p64. Debtap-p64 is a slight variant of debtap that converts 32-bit .deb packages into pseudo-64-bit Arch Linux packages (example of pseudo-64-bit package: skype in multilib) written to convert 32-bit .deb packages that have no 64-bit version (mainly closed-source packages).

https://github.com/helixarch/debtap-p64
https://aur.archlinux.org/packages/debtap-p64

Offline

#7 2014-10-06 19:41:53

deagon
Member
Registered: 2014-07-24
Posts: 5

Re: Debtap - A script to convert .deb packages to Arch Linux packages

Hi helix. I've had trouble trying to use your script with ubuntu software from The Open University

debtap OpenUniversity-ubuntu-0.1.3.20130104.deb
==> Extracting package data...
==> Fixing possible directories structure differencies...
==> Generating .PKGINFO file...
debtap OpenUniversity-ubuntu-0.1.3.20130104.deb
==> Extracting package data...
==> Fixing possible directories structure differencies...
==> Generating .PKGINFO file...

:: Enter Packager name:
NewPepper2013

:: Enter package license (you can enter multiple licenses comma seperated):
closed

:: If you want to edit .PKGINFO file, press (1) For vi (2) For nano (3) For a cu                                                                                                    stom editor or any other key to continue:

==> Generating .MTREE file...

==> Creating final package...
xz: unrecognized option '--1-any.pkg.tar'
xz: Try `xz --help' for more information.
mv: cannot stat ‘*.xz’: No such file or directory
==> Removing leftover files...
==> Package successfully created!

The software is called NewPepper 2013 but i've not been able to find it online except on the ou website.

Offline

#8 2014-10-06 19:51:59

helix
Member
Registered: 2013-02-17
Posts: 180

Re: Debtap - A script to convert .deb packages to Arch Linux packages

Hi Deagon. When you are prompt to edit .PKGINFO, choose an editor of your choice and fix manually any unvalid entry starting with the package name and version to see if there are any invalid characters among them.

Offline

#9 2014-10-06 21:47:42

deagon
Member
Registered: 2014-07-24
Posts: 5

Re: Debtap - A script to convert .deb packages to Arch Linux packages

oops. i assumed that was totally automatic, my bad. Worked a treat this time though. Thank you helix. smile

Offline

#10 2014-10-06 21:50:56

helix
Member
Registered: 2013-02-17
Posts: 180

Re: Debtap - A script to convert .deb packages to Arch Linux packages

You are welcome smile No, it can't be 100% automatic, because there are a few (notably rare) cases that you have to manually edit metadata files. But debtap tries to cover as many as possible. I'm glad it helped you smile

Last edited by helix (2014-10-06 21:52:25)

Offline

#11 2014-11-22 22:06:52

helix
Member
Registered: 2013-02-17
Posts: 180

Re: Debtap - A script to convert .deb packages to Arch Linux packages

First update for both debtap and debtap-p64, new version 1.1

Changes include improvements in algorithms, fixes and better colorisation.

Offline

#12 2014-11-26 03:46:31

sqlpython
Member
Registered: 2012-08-20
Posts: 9

Re: Debtap - A script to convert .deb packages to Arch Linux packages

Nice Script!
A very worth while contribution.
Good work and Thank You.

Offline

#13 2014-11-29 06:43:04

mittens2001
Member
Registered: 2014-10-18
Posts: 5

Re: Debtap - A script to convert .deb packages to Arch Linux packages

Getting

/usr/bin/debtap-p64: line 3158: list: command not found

when I try to use the script with this.

Offline

#14 2014-11-29 11:11:13

helix
Member
Registered: 2013-02-17
Posts: 180

Re: Debtap - A script to convert .deb packages to Arch Linux packages

Thanks for the feedback, now it's fixed. New version for both debtap and debtap-p64, minor update 1.1.1 with typo fixes.

Offline

#15 2014-12-01 05:08:36

helix
Member
Registered: 2013-02-17
Posts: 180

Re: Debtap - A script to convert .deb packages to Arch Linux packages

New version 1.2 for debtap and debtap-p64, fixed a small bug

Offline

#16 2014-12-01 19:57:40

helix
Member
Registered: 2013-02-17
Posts: 180

Re: Debtap - A script to convert .deb packages to Arch Linux packages

New update 1.2.1 with a few improvements in algorithms

Offline

#17 2014-12-25 14:12:38

helix
Member
Registered: 2013-02-17
Posts: 180

Re: Debtap - A script to convert .deb packages to Arch Linux packages

Merry Christmas to all of you with a minor update 1.2.2 (code cleaning)!

Plus, a video tutorial someone uploaded on YouTube yesterday and I thank him for this:

www.youtube.com/watch?v=3ZvjXnI_eTU

Offline

#18 2014-12-27 10:07:31

helix
Member
Registered: 2013-02-17
Posts: 180

Re: Debtap - A script to convert .deb packages to Arch Linux packages

Update 1.3. Added two options:

-q   Bypass all questions, except for editing metadata file(s)
-Q   Bypass all questions (not recommended)

Offline

#19 2014-12-27 10:26:41

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: Debtap - A script to convert .deb packages to Arch Linux packages

this program converts the bundle post/pre/install/remove/etc scripts in deb packages?

Last edited by sl1pkn07 (2014-12-27 10:37:59)

Offline

#20 2014-12-27 10:37:05

helix
Member
Registered: 2013-02-17
Posts: 180

Re: Debtap - A script to convert .deb packages to Arch Linux packages

No. I worked on that when script was still in beta development, but I abandoned the idea due to risk of breaking the system. Instead it generates .INSTALL file based on two templates inside the script, one for qt apps and one for gtk apps.

Offline

#21 2015-01-21 02:38:00

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 106
Website

Re: Debtap - A script to convert .deb packages to Arch Linux packages

Hello,

Any idea how to do the reverse : I mean, make a debian|ubuntu package from my PKGBUILD ?

Regards

Offline

#22 2015-01-21 02:52:38

helix
Member
Registered: 2013-02-17
Posts: 180

Re: Debtap - A script to convert .deb packages to Arch Linux packages

I'm not aware of any tool doing the opposite, sorry.

Edit: The only related package I could find in AUR is unipkg, but currently is flagged out of date.

Last edited by helix (2015-01-21 02:55:28)

Offline

#23 2015-01-21 02:56:05

ids1024
Member
From: California
Registered: 2013-08-16
Posts: 243
Website

Re: Debtap - A script to convert .deb packages to Arch Linux packages

@CyrIng See https://bbs.archlinux.org/viewtopic.php?id=175409.

Checkinstall might do what you want.


"Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."—Linus Torvalds
s/ftp/git/

https://iandouglasscott.com | https://github.org/ids1024 | https://keybase.io/ids1024

Offline

#24 2015-01-21 03:38:54

CyrIng
Member
From: France
Registered: 2010-07-17
Posts: 106
Website

Re: Debtap - A script to convert .deb packages to Arch Linux packages

helix , ids1024: thanks for helping however unipkg and checkinstall failed to compile

I'm gonna virtualized a small ubuntu for packaging purpose.

Regards
CyrIng

Offline

#25 2015-01-21 04:41:08

ids1024
Member
From: California
Registered: 2013-08-16
Posts: 243
Website

Re: Debtap - A script to convert .deb packages to Arch Linux packages

Use the unipkg github: https://github.com/matthewbauer/unipkg

With the PKGBUILD in the git repo, I was able to build and install it.  I have not tested it.


"Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."—Linus Torvalds
s/ftp/git/

https://iandouglasscott.com | https://github.org/ids1024 | https://keybase.io/ids1024

Offline

Board footer

Powered by FluxBB