![尝试在代理后运行“sudo apt-get update”时出现“无法启动与 in.archive.ubuntu.com:80 的连接”](https://linux22.com/image/1130587/%E5%B0%9D%E8%AF%95%E5%9C%A8%E4%BB%A3%E7%90%86%E5%90%8E%E8%BF%90%E8%A1%8C%E2%80%9Csudo%20apt-get%20update%E2%80%9D%E6%97%B6%E5%87%BA%E7%8E%B0%E2%80%9C%E6%97%A0%E6%B3%95%E5%90%AF%E5%8A%A8%E4%B8%8E%20in.archive.ubuntu.com%3A80%20%E7%9A%84%E8%BF%9E%E6%8E%A5%E2%80%9D.png)
我对 Ubuntu 还很陌生。我也使用了安全代理。当我尝试运行时,sudo apt-get update
出现以下错误。
blah@blah-hp-15-notebook-pc:~$ sudo apt-get update
Err http://security.ubuntu.com vivid-security InRelease
Err http://in.archive.ubuntu.com vivid InRelease
Err http://security.ubuntu.com vivid-security Release.gpg
Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
Err http://in.archive.ubuntu.com vivid-updates InRelease
Err http://in.archive.ubuntu.com vivid-backports InRelease
Err http://in.archive.ubuntu.com vivid Release.gpg
Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
Err http://in.archive.ubuntu.com vivid-updates Release.gpg
Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
Err http://in.archive.ubuntu.com vivid-backports Release.gpg
Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
Reading package lists... Done
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/vivid/InRelease
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/vivid-updates/InRelease
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/vivid-backports/InRelease
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/vivid-security/InRelease
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/vivid-security/Release.gpg Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/vivid/Release.gpg Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/vivid-updates/Release.gpg Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/vivid-backports/Release.gpg Cannot initiate the connection to in.archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
有人知道如何开始修复它吗?
答案1
答案2
您可以在以下位置添加代理设置/etc/apt/apt.conf文件;
echo "Acquire::http::proxy \"http://<proxy_server>:<port>/\";" >> /etc/apt/apt.conf
echo "Acquire::https::proxy \"https://<proxy_server>:<port>/\";" >> /etc/apt/apt.conf
之后,您可以尝试;
sudo apt-get update
答案3
可能是你的网络连接有问题。我遇到了同样的问题,然后连接到另一个 wifi,问题就解决了
答案4
我也遇到过这个问题。对我来说,这是一个与网络相关的问题,缺少默认网关配置。添加了默认网关以解决此问题