We already learned how to build packages for multiple platforms, and how to build packages from source. Today, we are going to learn how to convert DEB packages into Arch Linux packages.
You might wonder why would I need to convert a DEB package into Arch Linux package while AUR, the largest unofficial software repository, has almost all software in it?
True! However, some packages cannot be compiled (for example, closed source packages) or cannot be built from AUR for various reasons like error during compiling or unavailable dependency files.
Or the developer the developer doesn't has time to build a package in AUR or s/he doesn't like to create an AUR package. The reasons could be many.
In such cases, you can use a shell script called Debtap to convert DEB packages into Arch Linux packages. For those wondering, Debtap stands for DEB To Arch (Linux) Package.
Table of Contents
Install Debtap in Arch Linux
Debtap is available in AUR, so you can install it using the AUR helper tools such as Paru or Yay.
To install debtap using Paru, run:
$ paru -S debtap
Using Yay:
$ yay -S debtap
And, make sure your Arch system should have bash, binutils, pkgfile and fakeroot packages installed.
After installing Debtap and all above mentioned dependencies, run the following command to create/update pkgfile and debtap database.
$ sudo debtap -u
Sample output:
==> Synchronizing pkgfile database... :: Updating 6 repos... download complete: archlinuxfr [ 151.7 KiB 67.5K/s 5 remaining] download complete: multilib [ 319.5 KiB 36.2K/s 4 remaining] download complete: core [ 707.7 KiB 49.5K/s 3 remaining] download complete: testing [ 1716.3 KiB 58.2K/s 2 remaining] download complete: extra [ 7.4 MiB 109K/s 1 remaining] download complete: community [ 16.9 MiB 131K/s 0 remaining] :: download complete in 131.47s < 27.1 MiB 211K/s 6 files > :: waiting for 1 process to finish repacking repos... ==> Synchronizing debtap database... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 34.1M 100 34.1M 0 0 206k 0 0:02:49 0:02:49 --:--:-- 180k % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 814k 100 814k 0 0 101k 0 0:00:08 0:00:08 --:--:-- 113k % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 120k 100 120k 0 0 61575 0 0:00:02 0:00:02 --:--:-- 52381 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 35.4M 100 35.4M 0 0 175k 0 0:03:27 0:03:27 --:--:-- 257k ==> Downloading latest virtual packages list... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 149 0 149 0 0 49 0 --:--:-- 0:00:03 --:--:-- 44 100 11890 0 11890 0 0 2378 0 --:--:-- 0:00:05 --:--:-- 8456 ==> Downloading latest AUR packages list... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 264k 0 264k 0 0 30128 0 --:--:-- 0:00:09 --:--:-- 74410 ==> Generating base group packages list... ==> All steps successfully completed!
You must run the above command at least once.
Now, it's time for package conversion.
Convert DEB packages into Arch linux packages using Debtap
To convert any DEB package, say Quadrapassel, to Arch Linux package using debtap, do:
$ debtap quadrapassel_3.22.0-1.1_arm64.deb
The above command will convert the given .deb file into a Arch Linux package. You will be asked to enter the name of the package maintainer and license. Just enter them and hit ENTER key to start the conversion process.
The package conversion will take from a few seconds to several minutes depending upon your CPU speed. Grab a cup of coffee.
Sample output:
==> Extracting package data... ==> Fixing possible directories structure differencies... ==> Generating .PKGINFO file... :: Enter Packager name: quadrapassel :: Enter package license (you can enter multiple licenses comma separated): GPL *** Creation of .PKGINFO file in progress. It may take a few minutes, please wait... Warning: These dependencies (depend = fields) could not be translated into Arch Linux packages names: gsettings-backend ==> Checking and generating .INSTALL file (if necessary)... :: If you want to edit .PKGINFO and .INSTALL files (in this order), press (1) For vi (2) For nano (3) For default editor (4) For a custom editor or any other key to continue: ==> Generating .MTREE file... ==> Creating final package... ==> Package successfully created! ==> Removing leftover files...
Note: Quadrapassel package is already available in the Arch Linux official repositories. I used it just for demonstration purpose.
If you don't want to answer any questions during package conversion, use -q
flag to bypass all questions, except for editing metadata file(s).
$ debtap -q quadrapassel_3.22.0-1.1_arm64.deb
To bypass all questions (not recommended though), use -Q
flag.
$ debtap -Q quadrapassel_3.22.0-1.1_arm64.deb
Once the conversion is done, you can install the newly converted package using "pacman" in your Arch system as shown below.
$ sudo pacman -U <package-name>
Getting help
To display the help section, use -h
flag:
$ debtap -h Syntax: debtap [options] package_filename Options: -h --h -help --help Prints this help message -u --u -update --update Update debtap database -q --q -quiet --quiet Bypass all questions, except for editing metadata file(s) -Q --Q -Quiet --Quiet Bypass all questions (not recommended) -s --s -pseudo --pseudo Create a pseudo-64-bit package from a 32-bit .deb package -w --w -wipeout --wipeout Wipeout versions from all dependencies, conflicts etc. -p --p -pkgbuild --pkgbuild Additionally generate a PKGBUILD file -P --P -Pkgbuild --Pkgbuild Generate a PKGBUILD file only
Resource:
12 comments
https://github.com/jordansissel/fpm is another good tool to convert packages:
Sources:
gem (even autodownloaded for you)
python modules (autodownload for you)
pear (also downloads for you)
directories
tar(.gz) archives
rpm
deb
node packages (npm)
pacman (ArchLinux) packages
Targets:
deb
rpm
solaris
freebsd
tar
directories
Mac OS X .pkg files (osxpkg)
pacman (ArchLinux) packages
Yeah, I already have posted about it. https://ostechnix.com/build-linux-packages-multiple-platforms-easily/
:+1:
This is very interesting to me. The most important thing to me has always been access to the most apps. It’s why we run OSes, afterall. I’m a DEB user but have heard about Arch and some of it’s offshoots. I believe there is good work being done on rolling releases, which is something I’m increasingly interested in.
Would you know (based on your research) if the conversion success rate for DEBtap is 100% or close to it?
As far as I tested, the success rate was 100%.
thanks alot, helpfull… work fine on manjaro.
Thanks, the vscode package at AUR is failing to compile, so I use debtap to convert the vscode downloaded from the website and this worked like a charm.
“the developer is too lazy”. That’s hard to swallow, for a developer. The process of developing software is intensive, and packaging software is almost never easy. In a lot of cases, it takes quite some tinkering to create packages which are compatible with multiple systems.
I came here, because I want to provide a AUR package for my app (which is now packaged as .deb and .rpm). I’ve installed Manjaro Linux and am now trying to install the tools necessary to convert the .deb package to a Arch-compatible package. For my case, your instructions seem insufficient. “yay” is not found on my system. This might be related to the fact that I’m using a arch derivative and not the real deal. But, at this point, I’m not sure yet. So I now have to find more instructions on the internet on how to get yay on my system. Because I have no knowlegde of Arch or Manjaro, that is not an easy task.
Long story short: the reason why a developer doesn’t provide a package for a specific system, is not related to laziness. It is related to the complexity of creating such package.
yay is just another helper for the AUR. https://ostechnix.com/yay-found-yet-another-reliable-aur-helper/
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
You are a life saver. An updated Arch package gave me problem and I wasn’t able to find historical version on AUR
Nice post, easily explained, thank you for the relevant information, help me a lot.
Thans!!!