我已经看到一些关于这个问题的提问,但没有一个与我的问题相同。我在我们的数据中心运行着一个Ubuntu 16.04服务器,因此它在技术上是一个虚拟机。我已经安装了Docker,现在我正在尝试构建以下Dockerfile:
FROM ubuntu:16.04
RUN apt-get update
更新失败。我得到了一堆这样的东西:
Ign:35 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse all Packages
Ign:36 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages
Ign:37 http://archive.ubuntu.com/ubuntu xenial-backports/main all Packages
Ign:38 http://archive.ubuntu.com/ubuntu xenial-backports/restricted amd64 Packages
Ign:39 http://archive.ubuntu.com/ubuntu xenial-backports/restricted all Packages
Ign:40 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages
Ign:41 http://archive.ubuntu.com/ubuntu xenial-backports/universe all Packages
然后:
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/source/Sources 403 Forbidden [IP: 91.189.91.26 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/universe/source/Sources 403 Forbidden [IP: 91.189.88.152 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/universe/source/Sources 403 Forbidden [IP: 91.189.88.152 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-amd64/Packages 403 Forbidden [IP: 91.189.88.152 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
在我的服务器上运行sudo apt-get update
(而不是Docker镜像中)完全正常。
/etc/hosts
)来避免 DNS 的随机性。 - Dirk Eddelbuettel