Apt-Get 更新获取失败;无法连接

Apt-Get 更新获取失败;无法连接

在 Ubuntu 14.04.3 LTS 上尝试运行 apt-get update 时,我收到此信息:

Err http://us.archive.ubuntu.com trusty InRelease

Err http://us.archive.ubuntu.com trusty-updates InRelease

Err http://us.archive.ubuntu.com trusty-backports InRelease

Err http://us.archive.ubuntu.com trusty Release.gpg
  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
Err http://us.archive.ubuntu.com trusty-updates Release.gpg
  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
Err http://us.archive.ubuntu.com trusty-backports Release.gpg
  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]
Err http://security.ubuntu.com trusty-security InRelease

Err http://security.ubuntu.com trusty-security Release.gpg
  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.201 80]
Reading package lists... Done
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/InRelease

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/InRelease

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.13 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.201 80]

W: Some index files failed to download. They have been ignored, or old ones used instead.

过去,我能够成功地在这台机器上执行 apt-get update 和 upgrade。我不确定发生了什么变化。我可以正常 ping 地址。我使用 8.8.8.8 和 8.8.4.4 作为 DNS。我没有使用代理。

答案1

检查以下情况:

  1. 检查您的互联网连接。

  2. ping 任何网站(www.google.com),它将帮助您确定数据包是否收到。

  3. 检查是否设置了任何代理。

  4. 在浏览器中检查任何网站(chrome/firefox)

答案2

您需要更新名称服务器/etc/resolv.conf

执行cat /etc/resolv.conf,看看输出是否有类似这样的内容:

# [network]
# generateResolvConf = false
nameserver 172.X.X.X

您需要将名称服务器更改为8.8.8.8,因此运行sudo nano /etc/resolv.conf、编辑并保存文件。

然后尝试运行sudo apt update并查看是否有效。

相关内容