我目前正在尝试在我的 amd64 系统上主要安装 libdbus-1.so(也就是 libdbus-1-dev:arm64 包),以便我可以交叉编译 rust 应用程序。但不知何故它不起作用,因为我总是运行此错误:
$ sudo apt-get install libdbus-1-dev:arm64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libdbus-1-dev:arm64 : Depends: libdbus-1-3:arm64 (= 1.12.16-2ubuntu2.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
这里有人能告诉我如何在 Linux 上安装 arm64 包(包括它的依赖项)吗?
供您参考,我正在运行 ubuntu 20.04。
答案1
在一个新的最小交叉编译 chroot 中,我可以很好地安装该包
$ mk-sbuild --target arm64 focal
$ schroot -u root -c focal-amd64-arm64
(focal-amd64-arm64)# apt update; apt full-upgrade
(focal-amd64-arm64)# apt install libdbus-1-dev:arm64
...
The following additional packages will be installed:
libdbus-1-3:arm64 libgcrypt20:arm64 libgpg-error0:arm64 liblz4-1:arm64
liblzma5:arm64 libsystemd0:arm64
The following NEW packages will be installed:
libdbus-1-3:arm64 libdbus-1-dev:arm64 libgcrypt20:arm64 libgpg-error0:arm64
liblz4-1:arm64 liblzma5:arm64 libsystemd0:arm64
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 1126 kB of archives.
After this operation, 3815 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
可能是您的本地系统为任一主机或任何其他交叉编译架构安装了过期的软件包,从而阻止了安装。如果您升级所有软件包,并明确列出 apt 抱怨的软件包,您可能会收到更好的消息。
请尝试:
$ sudo apt update; sudo apt full-upgrade
$ sudo apt install libdbus-1-3:arm64
$ sudo apt install libdbus-1-dev:arm64
$ sudo apt install libdbus-1-dev:arm64 libdbus-1-3:arm64
上述步骤可能会产生不同的、但愿是更具信息量的消息,说明为什么 apt 放弃安装您想要的内容。