apt-get update 無法連線到伺服器

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
    

它似乎與代理或防火牆有關,但我不使用它們中的任何一個。有人知道如何解決這個問題嗎?

答案1

我的問題解決了。我不知道是什麼讓它再次發揮作用。我嘗試了這些命令unset http_proxyunset https_proxy按照 @nilesh_101 的建議。我做的另一件事是更改代理,然後再次將其更改為預設代理。謝謝大家回答我的問題!

答案2

我遇到了同樣的問題。

相關內容