软件包架构 aarch64 与系统架构 arm64 不匹配(dpkg)

软件包架构 aarch64 与系统架构 arm64 不匹配(dpkg)

在适用于 Raspberry Pi LTS 版本的 Ubuntu 20.04 上...架构应该是 aarch64(这是 Raspberry Pi 4b 的正确架构,也是 uname -i 输出中显示的内容)。

我从 Raspberry Pi 上的源代码编译了 openboard 项目(不是交叉编译)。Github 上包含的此项目的构建和打包脚本正确创建了一个 aarch64 debian 包,该包现在位于我的主目录中,等待安装。

但是,当我第一次运行 dpkg 时,它似乎认为我的架构是 arm64:

ubuntu@ubuntu:~/openboard/OpenBoard/install/linux$ sudo dpkg -i openboard_ubuntu_20.04_1.5.4_aarch64.deb 
    dpkg: error processing archive openboard_ubuntu_20.04_1.5.4_aarch64.deb (--install):
     package architecture (aarch64) does not match system (arm64)
    Errors were encountered while processing:
     openboard_ubuntu_20.04_1.5.4_aarch64.deb

请注意,umake 正确地将系统设置为 aarch64:

qmake -v
QMake version 3.1
Using Qt version 5.12.8 in /usr/lib/aarch64-linux-gnu
ubuntu@ubuntu:~/openboard/OpenBoard/install/linux$ ls -l
total 23748
-rw-r--r-- 1 root root 24314184 Sep 15 20:45 openboard_ubuntu_20.04_1.5.4_aarch64.deb
ubuntu@ubuntu:~/openboard/OpenBoard/install/linux$ uname -i
aarch64

我尝试将架构添加到 dpkg 中,但是这却把事情搞得一团糟:

sudo dpkg --add-architecture arm64

现在,当我尝试 dpkg 时,它会喷出一堆 aarch64 依赖项:

sudo dpkg -i openboard_ubuntu_20.04_1.5.4_aarch64.deb 
Selecting previously unselected package openboard:aarch64.
(Reading database ... 215358 files and directories currently installed.)
Preparing to unpack openboard_ubuntu_20.04_1.5.4_aarch64.deb ...
Unpacking openboard:aarch64 (1.5.4) ...
dpkg: dependency problems prevent configuration of openboard:aarch64:
 openboard:aarch64 depends on libpaper1 (>= 1.1.28).
 openboard:aarch64 depends on libavformat58 (>= 7:4.2.4).
 openboard:aarch64 depends on libavcodec58 (>= 7:4.2.4).
 openboard:aarch64 depends on libswresample3 (>= 7:4.2.4).
 openboard:aarch64 depends on libswscale5 (>= 7:4.2.4).
 openboard:aarch64 depends on libavutil56 (>= 7:4.2.4).
 openboard:aarch64 depends on zlib1g (>= 1:1.2.11).
 openboard:aarch64 depends on libssl1.1 (>= 1.1.1).
 openboard:aarch64 depends on libx11-6 (>= 2:1.6.9).
 openboard:aarch64 depends on libqt5webkit5 (>= 5.212.0~).
 openboard:aarch64 depends on libqt5svg5 (>= 5.12.8).
 openboard:aarch64 depends on libqt5multimediawidgets5 (>= 5.12.8).
 openboard:aarch64 depends on libqt5widgets5 (>= 5.12.8).
 openboard:aarch64 depends on libqt5multimedia5 (>= 5.12.8).
 openboard:aarch64 depends on libqt5gui5 (>= 5.12.8).
 openboard:aarch64 depends on libqt5network5 (>= 5.12.8).
 openboard:aarch64 depends on libqt5xml5 (>= 5.12.8).
 openboard:aarch64 depends on libqt5script5 (>= 5.12.8).
 openboard:aarch64 depends on libqt5core5a (>= 5.12.8).
 openboard:aarch64 depends on libc6 (>= 2.31).
 openboard:aarch64 depends on libstdc++6 (>= 10).
 openboard:aarch64 depends on libgomp1 (>= 10).
 openboard:aarch64 depends on libgcc-s1 (>= 10).
 openboard:aarch64 depends on onboard.
 openboard:aarch64 depends on libqt5multimedia5-plugins.

dpkg: error processing package openboard:aarch64 (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Errors were encountered while processing:
 openboard:aarch64

您可能可以想象,上面显示为依赖项的所有软件包实际上都已安装,并且是最新版本。

我确信我忽略了一些明显的东西,但是什么呢?

答案1

我刚刚遇到了同样的问题,但幸运的是我找到了解决方案。

首先,如果您检查您的架构,您应该看到以下内容:

$ arch
aarch64
$ uname -m
aarch64

如果你检查一下,dpkg就会发现这其实就是问题的根源。它错误地认为aarch64系统是arm64

$ dpkg --print-architecture
arm64

如果你检查你的 Debian 包文件,你可以验证包是否正确显示aarch64

$ dpkg --info openboard_ubuntu_20.04_1.5.4_aarch64.deb
...
Architecture: aarch64

当您添加架构时,您已经接近了,但您实际上需要做的是添加,aarch64因为系统当前认为它是arm64

$ sudo dpkg --add-architecture aarch64

现在您应该能够顺利安装您的软件包了。

相关内容