我已经设置了一个交叉编译的 docker 实例。简而言之,我开始设置
apt-get update
apt-get install binutils-multiarch
dpkg --add-architecture armhf
# Manually add correct armhf repositories to /etc/apt/sources.list
apt-get update
apt-get install libudev-dev:armhf
在这最后一步中,我收到以下错误:
The following packages have unmet dependencies:
libudev-dev:armhf : Depends: libacl1:armhf (>= 2.2.51-8) but it is not going to be installed
Depends: libblkid1:armhf (>= 2.19.1) but it is not going to be installed
Depends: libc6:armhf (>= 2.17) but it is not going to be installed
Depends: libgcc1:armhf (>= 1:3.5) but it is not going to be installed
Depends: libkmod2:armhf (>= 5~) but it is not going to be installed
Depends: libselinux1:armhf (>= 2.0.65) but it is not going to be installed
Depends: libudev1:armhf (= 229-4ubuntu4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
手动安装这些不是一个选项,因为libc6:armhf
与当前安装的 amd64 libc6 冲突并且最终会覆盖这个包。我只想设置libudev:armhf
包以便我可以链接到它。
/etc/apt/sources.list:
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial main restricted
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ xenial-updates universe
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ xenial-security main restricted
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ xenial-security universe
deb [arch=amd64] http://security.ubuntu.com/ubuntu/ xenial-security multiverse
运行apt-cache policy libudev-dev:{amd64,armhf}
输出以下内容:
libudev-dev:
Installed: (none)
Candidate: 229-4ubuntu21.4
Version table:
229-4ubuntu21.4 500
500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
229-4ubuntu21.1 500
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
229-4ubuntu4 500
500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
libudev-dev:armhf:
Installed: (none)
Candidate: 229-4ubuntu4
Version table:
229-4ubuntu4 500
500 http://ports.ubuntu.com/ubuntu-ports xenial/main armhf Packages
第 1 步 - 打开终端:
按Ctrl+ Alt+ T。
第 2 步 - 备份:
执行:
第 3 步 - 打开编辑器:
执行:
如果需要,您可以使用其他编辑器。
第 4 步 - 编辑
sources.list
:删除此处的所有内容并添加以下内容:
保存并退出。
第 5 步 - 更新您的存储库索引:
执行:
libudev-dev
第6 步 - 安装armhf
架构:执行:
澄清: Multiarch 软件包需要在所有架构上安装相同的版本。因此,您应该有
libudev-dev:armhf
with version229-4ubuntu21.4
,但您当前的存储库配置不包括此版本。因此,您应该添加xenial-updates
支持此版本的行。关于其他建议添加频道,我建议您添加这些以防出现问题。