延伸 apt 更新失败,镜像上缺少 InRelease 文件

延伸 apt 更新失败,镜像上缺少 InRelease 文件

两小时前我尝试手动更新软件包。我的镜子中确实缺少 InReleasehttp://ftp.fr.debian.org/debian/dists/stretch/InRelease,也是来自CDN之一http://deb.debian.org/debian/dists/stretch/InRelease

预计该 InRelease 文件会因拉伸而丢失吗?

me@stretch:~$ LANG=C sudo apt update
Err:1 http://ftp.fr.debian.org/debian stretch InRelease
  Temporary failure resolving 'ftp.fr.debian.org'
Err:2 http://security.debian.org/debian-security stretch/updates InRelease
  Temporary failure resolving 'security.debian.org'
Err:3 http://ftp.fr.debian.org/debian stretch-updates InRelease
  Temporary failure resolving 'ftp.fr.debian.org'
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://ftp.fr.debian.org/debian/dists/stretch/InRelease  Temporary failure resolving 'ftp.fr.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/InRelease  Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://ftp.fr.debian.org/debian/dists/stretch-updates/InRelease  Temporary failure resolving 'ftp.fr.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

手动尝试 wget InRelease 文件(网络连接正常,如您所见):

me@stretch:~$ LANG=C wget http://deb.debian.org/debian/dists/stretch/InRelease
--2018-10-28 23:29:52--  http://deb.debian.org/debian/dists/stretch/InRelease
Resolving deb.debian.org (deb.debian.org)... 2001:67c:2564:a119::148:14, 2001:4f8:1:c::15, 2001:41c8:1000:21::21:4, ...
Connecting to deb.debian.org (deb.debian.org)|2001:67c:2564:a119::148:14|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://cdn-fastly.deb.debian.org/debian/dists/stretch/InRelease [following]
--2018-10-28 23:29:52--  http://cdn-fastly.deb.debian.org/debian/dists/stretch/InRelease
Resolving cdn-fastly.deb.debian.org (cdn-fastly.deb.debian.org)... 2a04:4e42:1d::204, 151.101.120.204
Connecting to cdn-fastly.deb.debian.org (cdn-fastly.deb.debian.org)|2a04:4e42:1d::204|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-10-28 23:29:52 ERROR 404: Not Found.

答案1

如果你在码头工人您可以尝试重新启动 Docker 守护进程。

sudo systemctl restart docker

这为我解决了这个问题。

答案2

提到的唯一原因InRelease是这是 apt 尝试下载的第一个文件。实际错误发生在以下之后:

暂时无法解析“ftp.fr.debian.org”

(“security.debian.org”也是如此)

像这样的错误会导致下载任何文件时出现问题,因此显然第一次会失败。

您应该查看您的网络配置以找出无法解析这些名称的原因。

答案3

在我的 Debian 系统上,我验证了:

  • DNS解析我使用的debian镜像的ipv4 A和ipv6 AAAA记录(使用“dig”命令确认,默认DNS存储在resolv.conf中)
  • 当尝试下载与 apt-get 相同的 URL 时,wget 成功

因此,独立于 apt,我的 Debian 系统没有 DNS 或互联网连接问题。但 apt 不断失败,即使在/etc/apt/source.list.

我发现的唯一解决方法:直接在source.list.

答案4

您需要从 切换deb.debian.orgarchive.debian.org

有关更多信息,请参阅这个答案

相关内容