在 ubuntu bionic x64 上安装适用于 arm64 的库

在 ubuntu bionic x64 上安装适用于 arm64 的库

我想在我的 ubuntu bionic 中安装 arm64 库,以便我可以使用 cmake 进行交叉编译。以下是我根据以下内容进行的操作https://askubuntu.com/a/994650/613425

dpkg --add-architecture arm64\
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ bionic main restricted\n\
deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates main restricted\n\
deb [arch=arm64] http://ports.ubuntu.com/ bionic universe\n\
deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates universe\n\
deb [arch=arm64] http://ports.ubuntu.com/ bionic multiverse\n\
deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates multiverse\n\
deb [arch=arm64] http://ports.ubuntu.com/ bionic-backports main restricted universe multiverse"\
| tee -a /etc/apt/sources.list

给我

E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/universe/binary-arm64/Packages  404  Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/restricted/binary-arm64/Packages  404  Not Found [IP: 91.189.88.174 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/universe/binary-arm64/Packages  404  Not Found [IP: 91.189.88.174 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.174 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

答案1

在 / 中,etc/apt/sources.list您必须[arch=amd64]在 amd64 源前面添加(如果是其他源,则添加主机的系统架构)示例:

deb [arch=amd64] http://de2.archive.ubuntu.com/ubuntu/ bionic main restricted
deb-src [arch=amd64] http://de.archive.ubuntu.com/ubuntu/ bionic main restricted

相关内容