我们已经学会了如何 为多个平台构建包,以及如何 从源代码构建包. 今天,我们将学习如何将 DEB 包转换为 Arch Linux 包。
你可能想知道为什么我需要将 DEB 包转换为 Arch Linux 包,而 AUR,最大的非官方软件存储库,几乎所有软件都在里面?
真的! 但是,有些包无法编译(例如 example,封闭源代码包)或由于各种原因(例如编译期间的错误或不可用的依赖文件)无法从 AUR 构建。
或者开发人员没有时间在 AUR 中构建包,或者他/她不喜欢创建 AUR 包。 原因可能很多。
在这种情况下,您可以使用名为 债务 将 DEB 包转换为 Arch Linux 包。 对于那些想知道的人, 债务 代表 开发银行 吨○ 一种rch (Linux) 磷包装。
在 Arch Linux 中安装 Debtap
债务可在 AUR,因此您可以使用 AUR 辅助工具安装它,例如 帕鲁 或者 耶.
要使用 Paru 安装 debtap,请运行:
$ paru -S debtap
使用耶:
$ yay -S debtap
并且,确保你的 Arch 系统应该有 bash, 二进制工具, 包文件 和 假根 安装的软件包。
安装 Debtap 和上述所有依赖项后,运行以下命令来创建/更新 pkgfile 和 debtap 数据库。
$ sudo debtap -u
样本输出:
==> 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!
您必须至少运行一次上述命令。
现在,是时候进行包转换了。
使用 Debtap 将 DEB 包转换为 Arch linux 包
要转换任何 DEB 包,请说 四轮车,使用 debtap 到 Arch Linux 包,执行:
$ debtap quadrapassel_3.22.0-1.1_arm64.deb
上述命令会将给定的 .deb 文件转换为 Arch Linux 包。 您将被要求输入软件包维护者和许可证的名称。 只需输入它们并按 ENTER 键即可开始转换过程。
包转换将需要几秒钟到几分钟的时间,具体取决于您的 CPU 速度。 拿一杯咖啡。
样本输出:
==> 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...
笔记: Quadrapassel 包已经在 Arch Linux 官方存储库中可用。 我只是将它用于演示目的。
如果您不想在包转换过程中回答任何问题,请使用 -q
标志绕过所有问题,编辑元数据文件除外。
$ debtap -q quadrapassel_3.22.0-1.1_arm64.deb
要绕过所有问题(虽然不推荐),请使用 -Q
旗帜。
$ debtap -Q quadrapassel_3.22.0-1.1_arm64.deb
转换完成后,您可以使用安装新转换的包 “吃豆人” 在您的 Arch 系统中,如下所示。
$ sudo pacman -U <package-name>
获得帮助
要显示帮助部分,请使用 -h
旗帜:
$ 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
相关阅读:
- 如何从源代码构建 Debian 软件包
- 如何使用 Alien 转换 Linux 软件包
资源: