尝试在代理后运行“sudo apt-get update”时出现“无法启动与 in.archive.ubuntu.com:80 的连接”

尝试在代理后运行“sudo apt-get update”时出现“无法启动与 in.archive.ubuntu.com:80 的连接”

我对 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

我也遇到同样的问题。要解决这个问题,您需要将服务器更改为主服务器。

只需前往软件与更新并将服务器更改为主服务器旁边下载自

软件和更新对话框 - 下载自:主服务器

Ubuntu 安装后第一次你可能找不到主服务器选项。然后按照此操作 -下载自->其他...->选择最佳服务器->选择服务器。这将选择最佳服务器,可能需要一些时间。之后sudo apt-get 更新 && sudo apt-get 升级.如果你去检查下载自从现在起你会发现主服务器在可用列表中。

答案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

我也遇到过这个问题。对我来说,这是一个与网络相关的问题,缺少默认网关配置。添加了默认网关以解决此问题

相关内容