Ubuntu 18.04 无法安装docker报错 E: Unable to locate package docker-ce 的可能解决办法

用了个华为云的新服务器,首先是改了一下Ubuntu的镜像源,换了个中科大的(离得近),然后开始配环境。配环境的时候docker一直装不上,报错 E: Unable to locate package docker-ce 。然后看了一下安装过程,发现有这么一段报错:

E: Failed to fetch https://mirrors.ustc.edu.cn/ubuntu/dists/bionic/main/binary-arm64/Packages  404  Not Found [IP: 218.104.71.170 443]                                   
E: Failed to fetch https://mirrors.ustc.edu.cn/ubuntu/dists/bionic-security/main/binary-arm64/Packages  404  Not Found [IP: 218.104.71.170 443]                          
E: Failed to fetch https://mirrors.ustc.edu.cn/ubuntu/dists/bionic-updates/main/binary-arm64/Packages  404  Not Found [IP: 218.104.71.170 443]                           
E: Failed to fetch https://mirrors.ustc.edu.cn/ubuntu/dists/bionic-backports/main/binary-arm64/Packages  404  Not Found [IP: 218.104.71.170 443]                         
E: Some index files failed to download. They have been ignored, or old ones used instead.

这就很奇怪了,为啥会404呢?

后来发现,华为云的服务器居然是aarch64架构的……所以得用arm64的Ubuntu源才行。

首先换一个中科大的arm64源:

deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic main universe restricted
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic main universe restricted

然后再按照docker官网操作就行了。

这也太坑了……下次配环境之前得先检查一下架构。

相关推荐
©️2020 CSDN 皮肤主题: 书香水墨 设计师:CSDN官方博客 返回首页