两个小时前我尝试手动更新软件包。我的镜像http://ftp.fr.debian.org/debian/dists/stretch/InRelease确实缺少 InRelease ,但 CDN 中也缺少一个http://deb.debian.org/debian/dists/stretch/在释放。
是否预计此 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.
如果您在Docker容器中运行 Debian,您可以尝试重新启动 Docker 守护程序。
这为我解决了。
提到的唯一原因
InRelease
是这是 apt 尝试下载的第一个文件。实际错误紧随其后:(对于 'security.debian.org' 也是如此)
像这样的错误会导致下载任何文件时出现问题,所以很明显它首先会失败。
您应该查看您的网络配置以找出无法解析这些名称的原因。
在我的 debian 系统上,我验证了:
因此,独立于 apt,我的 debian 系统没有 DNS 或互联网连接问题。但是 apt 一直失败,即使在
/etc/apt/source.list
.我发现的唯一解决方法是:直接在
source.list
.