在新的 Ubuntu 18.04 映像上添加 arm64 多架构会导致错误

在新的 Ubuntu 18.04 映像上添加 arm64 多架构会导致错误

重现此问题的方法如下:

docker run -it ubuntu:18.04 bash

apt-get update
dpkg --add-architecture arm64
apt-get update

最后的输出apt-get update是很多行未找到的错误:

root@4b078bedbe38:/# apt-get update
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Ign:3 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Ign:5 http://security.ubuntu.com/ubuntu bionic-security/restricted arm64 Packages
Ign:6 http://security.ubuntu.com/ubuntu bionic-security/multiverse arm64 Packages
Ign:7 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages
Hit:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease        
Ign:3 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages
Ign:5 http://security.ubuntu.com/ubuntu bionic-security/restricted arm64 Packages
Ign:6 http://security.ubuntu.com/ubuntu bionic-security/multiverse arm64 Packages
Ign:7 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages
Ign:3 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages
Ign:5 http://security.ubuntu.com/ubuntu bionic-security/restricted arm64 Packages
Ign:9 http://archive.ubuntu.com/ubuntu bionic/restricted arm64 Packages  
Ign:10 http://archive.ubuntu.com/ubuntu bionic/main arm64 Packages       
Ign:11 http://archive.ubuntu.com/ubuntu bionic/universe arm64 Packages   
Ign:12 http://archive.ubuntu.com/ubuntu bionic/multiverse arm64 Packages 
Ign:6 http://security.ubuntu.com/ubuntu bionic-security/multiverse arm64 Packages
Ign:7 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages
Err:3 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages
  404  Not Found [IP: 91.189.91.39 80]
Ign:5 http://security.ubuntu.com/ubuntu bionic-security/restricted arm64 Packages
Ign:6 http://security.ubuntu.com/ubuntu bionic-security/multiverse arm64 Packages
Ign:7 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages
Ign:13 http://archive.ubuntu.com/ubuntu bionic-updates/main arm64 Packages
Ign:14 http://archive.ubuntu.com/ubuntu bionic-updates/restricted arm64 Packages
Ign:15 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse arm64 Packages
Ign:16 http://archive.ubuntu.com/ubuntu bionic-updates/universe arm64 Packages
Ign:9 http://archive.ubuntu.com/ubuntu bionic/restricted arm64 Packages
Ign:10 http://archive.ubuntu.com/ubuntu bionic/main arm64 Packages
Ign:11 http://archive.ubuntu.com/ubuntu bionic/universe arm64 Packages
Ign:12 http://archive.ubuntu.com/ubuntu bionic/multiverse arm64 Packages
Ign:17 http://archive.ubuntu.com/ubuntu bionic-backports/universe arm64 Packages
Ign:18 http://archive.ubuntu.com/ubuntu bionic-backports/main arm64 Packages
Ign:13 http://archive.ubuntu.com/ubuntu bionic-updates/main arm64 Packages
Ign:14 http://archive.ubuntu.com/ubuntu bionic-updates/restricted arm64 Packages
Ign:15 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse arm64 Packages
Ign:16 http://archive.ubuntu.com/ubuntu bionic-updates/universe arm64 Packages
Ign:9 http://archive.ubuntu.com/ubuntu bionic/restricted arm64 Packages
Ign:10 http://archive.ubuntu.com/ubuntu bionic/main arm64 Packages
Ign:11 http://archive.ubuntu.com/ubuntu bionic/universe arm64 Packages
Ign:12 http://archive.ubuntu.com/ubuntu bionic/multiverse arm64 Packages
Ign:17 http://archive.ubuntu.com/ubuntu bionic-backports/universe arm64 Packages
Ign:18 http://archive.ubuntu.com/ubuntu bionic-backports/main arm64 Packages
Ign:13 http://archive.ubuntu.com/ubuntu bionic-updates/main arm64 Packages
Ign:14 http://archive.ubuntu.com/ubuntu bionic-updates/restricted arm64 Packages
Ign:15 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse arm64 Packages
Ign:16 http://archive.ubuntu.com/ubuntu bionic-updates/universe arm64 Packages
Err:9 http://archive.ubuntu.com/ubuntu bionic/restricted arm64 Packages
  404  Not Found [IP: 91.189.88.152 80]
Ign:10 http://archive.ubuntu.com/ubuntu bionic/main arm64 Packages
Ign:11 http://archive.ubuntu.com/ubuntu bionic/universe arm64 Packages
Ign:12 http://archive.ubuntu.com/ubuntu bionic/multiverse arm64 Packages
Ign:17 http://archive.ubuntu.com/ubuntu bionic-backports/universe arm64 Packages
Ign:18 http://archive.ubuntu.com/ubuntu bionic-backports/main arm64 Packages
Err:13 http://archive.ubuntu.com/ubuntu bionic-updates/main arm64 Packages
  404  Not Found [IP: 91.189.88.152 80]
Ign:14 http://archive.ubuntu.com/ubuntu bionic-updates/restricted arm64 Packages
Ign:15 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse arm64 Packages
Ign:16 http://archive.ubuntu.com/ubuntu bionic-updates/universe arm64 Packages
Err:17 http://archive.ubuntu.com/ubuntu bionic-backports/universe arm64 Packages
  404  Not Found [IP: 91.189.88.152 80]
Ign:18 http://archive.ubuntu.com/ubuntu bionic-backports/main arm64 Packages
Reading package lists... Done
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/universe/binary-arm64/Packages  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/restricted/binary-arm64/Packages  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/universe/binary-arm64/Packages  404  Not Found [IP: 91.189.88.152 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
root@4b078bedbe38:/# 

为什么会发生这种情况?我该如何解决这些问题?我希望这可以在新的图像上起作用...

编辑 另一件奇怪的事情是这样的。在我自己的机器上,如果我运行,sudo apt-get install libopenblas-dev:arm64就会得到libopenblas-dev:arm64 is already the newest version,这意味着可以找到该包。

apt-get install libopenblas-dev:arm64但是,在 docker 镜像中运行该命令返回:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libopenblas-dev:arm64

不确定为什么在我的计算机上可以找到该包(也运行 Ubuntu 18.04),但在图像中却找不到。

答案1

这些存储库仅适用于i386amd64架构。请自行检查 (dists/focal/目录):http://archive.ubuntu.com/ubuntu

添加arm64位于http://ports.ubuntu.com/ubuntu-ports/

相关内容