WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Cannot update apt-get -Failed to fetch Connection failed [IP: 91.189.88.149 80]

Open frankfuu opened this issue 8 years ago • 25 comments

I'm running Ubuntu on WSL and wish to update my apt-get via sudo apt-get update but came across this error.

Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/universe/binary-amd64/Packages  Connection failed [IP: 91.189.88.149 80]

Running a lsb_release -a shows

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial

My Windows system

OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.17134 N/A Build 17134
Hotfix(s):                     4 Hotfix(s) Installed.
                                       [01]: KB2693643
                                       [02]: KB4103729
                                       [03]: KB4287903
                                       [04]: KB4284835

Here is the complete log

frank@WIN-D7471GB:~$ sudo apt-get update
[sudo] password for frank:
Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:2 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1,201 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial/main Translation-en [568 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [8,344 B]
Get:8 http://archive.ubuntu.com/ubuntu xenial/restricted Translation-en [2,908 B]
Ign:9 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
Ign:10 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en
Get:11 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB]
Get:12 http://archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB]
32% [Waiting for headers]
Ign:9 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
Ign:10 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en
Ign:9 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
Get:10 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en [6,256 kB]
Err:9 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
  Connection failed [IP: 91.189.88.149 80]
Fetched 247 kB in 2min 44s (1,504 B/s)
Reading package lists... Done
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/universe/binary-amd64/Packages  Connection failed [IP: 91.189.88.149 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

I'm not sure if this is the best place to post my issue if not, please provide suggestions.

Thanks.

frankfuu avatar Jul 05 '18 02:07 frankfuu

How often did you try to make sure that this is not a transient problem in connecting to 91.189.88.149?

Are you located in an environment - anti-virus tool / proxy / enterprise network / political zone etc - which would tend to introduce interesting behaviour into an otherwise plain and simple TCP/IP connection to an IP address which according to geo-coding to be located in Scotland (at least for me and with all the caveats that apply to geo-coding)?

If you are located in such an environment - have you tried outside of that environment?

shoffmeister avatar Jul 05 '18 14:07 shoffmeister

hi @shoffmeister ,

Strangely enough, I jumped onto a different machine on a different WAN network, with the same windows build and it worked fine. So it could be related to my company network.

OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.17134 N/A Build 17134
Hotfix(s):                    3 Hotfix(s) Installed.
                                  [01]: KB2693643
                                  [02]: KB4287903
                                  [03]: KB4284835
frank@WIN-DJB71X:~$ sudo apt-get update
[sudo] password for frank:
Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [518 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7,532 kB]
Get:7 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [222 kB]
Get:8 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [7,204 B]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/restricted Translation-en [2,152 B]
Get:10 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [356 kB]
Get:11 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [133 kB]
Get:12 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [3,456 B]
Get:13 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [1,744 B]
Get:14 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en [4,354 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB]
Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [804 kB]
Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [331 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [7,560 B]
Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/restricted Translation-en [2,272 B]
Get:21 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [641 kB]
Get:22 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [258 kB]
Get:23 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [16.4 kB]
Get:24 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [8,344 B]
Get:25 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [6,744 B]
Get:26 http://archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [4,180 B]
Get:27 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [7,412 B]
Get:28 http://archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [3,996 B]
Fetched 15.8 MB in 52s (302 kB/s)
Reading package lists... Done

frankfuu avatar Jul 06 '18 09:07 frankfuu

Same problem here. I can put the URL in a browser on the Windows host and the connection works. I can update my Linux laptop and it works. I cannot run "apt update" or curl that URL from within WSL. Yay Windows! Latest Bionic WSL from Windows store installed today.

howels avatar Sep 04 '18 13:09 howels

Had a similiar problem of failing all/some connections which prevented me to apt-get install gcc. Finally solved by looking at forums and trying everything i could:

  • editing /etc/resolv.conf and leaving only line "nameserver 8.8.4.4."
  • looking at the port behind ip adresses of failed connections and trying disabling network protection for the specified port in the antivirus settings (solved only for most connections, not all, even on that port)
  • completely turning off Kaspersky Free anitivirus
  • changing from connection through my dormitory's internet to a wifi connection i shared from my phone
  • (trying apt-get update first)

I dunno if all or only some of this helped, but somehow i got apt-get install gcc to download the rest and work.

Mizumaky avatar Nov 04 '18 21:11 Mizumaky

Had a similiar problem of failing all/some connections which prevented me to apt-get install gcc. Finally solved by looking at forums and trying everything i could:

* editing /etc/resolv.conf and leaving only line "nameserver 8.8.4.4."

* looking at the port behind ip adresses of failed connections and trying disabling network protection for the specified port in the antivirus settings (solved only for most connections, not all, even on that port)

* completely turning off Kaspersky Free anitivirus

* changing from connection through my dormitory's internet to a wifi connection i shared from my phone

* (trying apt-get update first)

I dunno if all or only some of this helped, but somehow i got apt-get install gcc to download the rest and work.

Completely closing Kaspersky fixed everything for me

Nerdsie avatar Nov 20 '18 19:11 Nerdsie

Same here, "Pause Protection" does not work. Had to stop the Kaspersky service and it started working.

chrisls121 avatar Nov 29 '18 20:11 chrisls121

I had the same issue with Zone Alarm Firewall - Snoozing doesn't work. it has to be completely stopped.

sofsip avatar Dec 17 '18 16:12 sofsip

Completely closing Kaspersky fixed everything for me

Also you can just temporarily switch off Kaspersky Free firewall for both 80 and 443 ports - in Настройки (Settings) -> Дополнительно (Additional?) -> Сеть (Network) -> Контролируемые порты (Protected network ports?) - custom network ports list in option Контролировать только выбранные (Protect only selected?). After successful apt-get update - switch them on again.

P.S. This also helped me with failing Ivy dependencies update in Scala sbt build. P.P.S And gradle builds too. Seems in both cases they were unable to connect to maven central.

igor-ye avatar Jan 21 '19 07:01 igor-ye

Had a similiar problem of failing all/some connections which prevented me to apt-get install gcc. Finally solved by looking at forums and trying everything i could:

  • editing /etc/resolv.conf and leaving only line "nameserver 8.8.4.4."
  • looking at the port behind ip adresses of failed connections and trying disabling network protection for the specified port in the antivirus settings (solved only for most connections, not all, even on that port)
  • completely turning off Kaspersky Free anitivirus
  • changing from connection through my dormitory's internet to a wifi connection i shared from my phone
  • (trying apt-get update first)

I dunno if all or only some of this helped, but somehow i got apt-get install gcc to download the rest and work.

only sudo apt-get update was enough for me.

SonyStone avatar Jul 18 '19 23:07 SonyStone

change your network, and have a try.

shutaozh avatar Aug 02 '19 08:08 shutaozh

try to run that command "sudo apt-get update" in tty, press ctrl + alt + f3 or f4, then run the command

herlianzhang avatar Aug 19 '19 14:08 herlianzhang

Avast is making troubles... I disabled it and this worked perfectly

z3nth10n avatar Mar 21 '20 17:03 z3nth10n

Had a similiar problem of failing all/some connections which prevented me to apt-get install gcc. Finally solved by looking at forums and trying everything i could:

  • editing /etc/resolv.conf and leaving only line "nameserver 8.8.4.4."
  • looking at the port behind ip adresses of failed connections and trying disabling network protection for the specified port in the antivirus settings (solved only for most connections, not all, even on that port)
  • completely turning off Kaspersky Free anitivirus
  • changing from connection through my dormitory's internet to a wifi connection i shared from my phone
  • (trying apt-get update first)

I dunno if all or only some of this helped, but somehow i got apt-get install gcc to download the rest and work.

Champ! I only changed one thing to get it working. Added "nameserver 8.8.8.8" to /etc/resolve.conf

Dwerg01 avatar May 21 '20 08:05 Dwerg01

Had a similiar problem of failing all/some connections which prevented me to apt-get install gcc. Finally solved by looking at forums and trying everything i could:

* editing /etc/resolv.conf and leaving only line "nameserver 8.8.4.4."

* looking at the port behind ip adresses of failed connections and trying disabling network protection for the specified port in the antivirus settings (solved only for most connections, not all, even on that port)

* completely turning off Kaspersky Free anitivirus

* changing from connection through my dormitory's internet to a wifi connection i shared from my phone

* (trying apt-get update first)

I dunno if all or only some of this helped, but somehow i got apt-get install gcc to download the rest and work.

For some reason with WSL2 I have to keep redoing this because resolve.conf resets at the default value each time I open a new instance, making apt-get and any other software that uses the internet to fail.

Using WSL2 on Windows 10 version 2004 with Ubuntu 20.04.

vncastanheira avatar May 23 '20 02:05 vncastanheira

do-release-upgrade solved the issue for me.

holzkohlengrill avatar May 26 '20 07:05 holzkohlengrill

  • changing from connection through my dormitory's internet to a wifi connection i shared from my phone

why only this way works for me? everything else doesn't work

khairaf avatar Sep 15 '20 14:09 khairaf

same problem here, solved by using VPN

verdian123 avatar Sep 27 '20 17:09 verdian123

You have to configure the proxy. Create a file named /etc/apt/apt.conf with this content (use your proxy settings!): Acquire::http::proxy "http://proxy:8080/"; Acquire::https::proxy "https://proxy:8080/";

PeterFlorian avatar Jun 08 '21 11:06 PeterFlorian

You should run the update command: sudo apt-get update

I faced this issue at the very beginning, after system installation. It helped.

makspundyk avatar Jan 23 '22 19:01 makspundyk

sudo apt-get update solved my issue

lucadonnoh avatar Mar 23 '22 21:03 lucadonnoh