我们已经学会了如何为多个平台构建包,以及如何从源代码构建包。 今天,我们将学习如何将 DEB 包转换为 Arch Linux 包。 您可能会问,AUR 是这个星球上的大型软件存储库,几乎所有的软件都可以在其中使用。 为什么我需要将 DEB 软件包转换为 Arch Linux 软件包? 这的确没错! 但是,由于某些软件包无法编译(封闭源代码软件包),或者由于各种原因(如编译时出错或文件不可用)而无法从 AUR 生成。 或者,开发人员懒得在 AUR 中构建一个包,或者他/她不想创建 AUR 包。 在这种情况下,我们可以使用这种快速但有点粗糙的方法将 DEB 包转换成 Arch Linux 包。
Debtap - 将 DEB 包转换成 Arch Linux 包
为此,我们将使用名为 “Debtap” 的实用程序。 它代表了 DEBT o A rch (Linux) P ackage。 Debtap 在 AUR 中可以使用,因此您可以使用 AUR 辅助工具(如 Pacaur、Packer 或 Yaourt )来安装它。
==> 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 转换包 Quadrapassel,你可以这样做:
1 2
debtap quadrapassel_3.22.0-1.1_arm64.deb
上述的命令会将 DEB 包文件转换为 Arch Linux 包。你需要输入包的维护者和许可证,输入他们,然后按下回车键就可以开始转换了。
:: 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: