apt-get update无法连接到服务器

我尝试在我的Ubuntu 15.04上获得更新但是如果无法连接到服务器

me@me:~$ sudo apt-get update Err http://archive.ubuntu.com vivid InRelease Err http://archive.ubuntu.com vivid-updates InRelease Err http://archive.ubuntu.com vivid-backports InRelease Err http://archive.ubuntu.com vivid-security InRelease Err http://archive.ubuntu.com vivid Release.gpg Unable to connect to 54.86.15.42:8080: Err http://archive.ubuntu.com vivid-updates Release.gpg Unable to connect to 54.86.15.42:8080: Err http://archive.ubuntu.com vivid-backports Release.gpg Unable to connect to 54.86.15.42:8080: Err http://archive.ubuntu.com vivid-security Release.gpg Unable to connect to 54.86.15.42:8080: Reading package lists... Done W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/vivid/InRelease W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/vivid-updates/InRelease W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/vivid-backports/InRelease W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/vivid-security/InRelease W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/vivid/Release.gpg Unable to connect to 54.86.15.42:8080: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/vivid-updates/Release.gpg Unable to connect to 54.86.15.42:8080: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/vivid-backports/Release.gpg Unable to connect to 54.86.15.42:8080: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/vivid-security/Release.gpg Unable to connect to 54.86.15.42:8080: W: Some index files failed to download. They have been ignored, or old ones used instead 

我试图找到解决方案,但无法修复它。 这是我到目前为止所尝试的:

  1. /etc/resolv.conf修改为:

     nameserver 8.8.8.8 nameserver 8.8.8.4 
  2. 我试着ping Ubuntu服务器

     me@me:~$ ping archive.ubuntu.com PING archive.ubuntu.com (91.189.91.15) 56(84) bytes of data. 64 bytes from likho.canonical.com (91.189.91.15): icmp_seq=1 ttl=41 time=259 ms 64 bytes from likho.canonical.com (91.189.91.15): icmp_seq=2 ttl=41 time=257 ms 64 bytes from likho.canonical.com (91.189.91.15): icmp_seq=3 ttl=41 time=255 ms 64 bytes from likho.canonical.com (91.189.91.15): icmp_seq=4 ttl=41 time=288 ms ^C --- archive.ubuntu.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3003ms rtt min/avg/max/mdev = 255.160/265.270/288.347/13.437 ms 
  3. 在“软件和更新”中,将服务器更改为主服务器

  4. /etc/apt/apt.conf我找到了这一行:

     Acquire::http::proxy 54.86.15.42:8080 

    我试图在它面前添加#并且不起作用。 然后尝试连接到54.86.15.42:8080并且没有任何反应。 并ping到这个地址:

     me@me:~$ sudo ping 54.86.15.42 PING 54.86.15.42 (54.86.15.42) 56(84) bytes of data. ^C --- 54.86.15.42 ping statistics --- 16 packets transmitted, 0 received, 100% packet loss, time 14999ms 

它似乎与代理或防火墙有关,但我不使用它们中的任何一个。 有人知道如何解决这个问题吗?

我的问题解决了。 我不知道是什么让它再次起作用。 我尝试了这些命令unset http_proxyunset https_proxy为@ nilesh_101建议。 我做的另一件事是更改代理,然后再次将其更改为默认值。 谢谢大家回答我的问题!

我遇到了同样的问题。然后我清除了apt.conf文件的所有内容,它完美无缺。