我的互联网连接正常,因为我可以通过 Firefox 访问网络,但是当我尝试通过终端或 Synaptic 安装软件包时收到连接失败消息。
Ign:1 http://ng.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libcurl4 amd64 7.58.0-2ubuntu3.8
Ign:2 http://ng.archive.ubuntu.com/ubuntu bionic-updates/main amd64 curl amd64 7.58.0-2ubuntu3.8
Err:1 http://security.ubuntu.com/ubuntu bionic-updates/main amd64 libcurl4 amd64 7.58.0-2ubuntu3.8
Connection failed [IP: 91.189.91.14 80]
Err:2 http://security.ubuntu.com/ubuntu bionic-updates/main amd64 curl amd64 7.58.0-2ubuntu3.8
Connection failed [IP: 91.189.88.24 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/curl/libcurl4_7.58.0-2ubuntu3.8_amd64.deb Connection failed [IP: 91.189.91.14 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/curl/curl_7.58.0-2ubuntu3.8_amd64.deb Connection failed [IP: 91.189.88.24 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
这就是上面突出显示的错误消息。
它昨天还在运行,我尝试了以下命令,
sudo apt-get clean
sudo apt-get update
sudo apt-get -f install
什么都没起作用。运行命令
wget http://security.ubuntu.com/ubuntu/pool/main/c/curl/libcurl4_7.58.0-2ubuntu3.8_amd64.deb
显示此错误
--2020-01-08 03:56:06-- (try: 2) http://security.ubuntu.com/ubuntu/pool/main/c/curl/libcurl4_7.58.0-2ubuntu3.8_amd64.deb
Connecting to security.ubuntu.com (security.ubuntu.com)|91.189.88.24|:80... connected.
HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.
Retrying.
--2020-01-08 03:56:08-- (try: 3) http://security.ubuntu.com/ubuntu/pool/main/c/curl/libcurl4_7.58.0-2ubuntu3.8_amd64.deb
Connecting to security.ubuntu.com (security.ubuntu.com)|91.189.88.24|:80... connected.
HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.
Retrying
如果有人能帮忙我会很高兴。
答案1
发生这种情况的原因如下:
- 您的 ISP 阻止了连接。请使用 vpn。(我遇到过这种情况)
- 服务器瘫痪了。(可能性很小)
- 您距离服务器太远。(您可以更改存储库镜像)
- 如果您使用公司或学校网络,则可能需要使用代理。
提示:尝试使用 Firefox 访问这些链接。