WSL icon indicating copy to clipboard operation
WSL copied to clipboard

apt-get update not working

Open Acenl12 opened this issue 6 years ago • 33 comments

Ubuntu 18.04 WSL

Please help fix this

sudo apt-get update
[sudo] password for guido:
Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out
Err:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable)
Err:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable)
Err:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
  Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable)
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.

Acenl12 avatar Apr 27 '20 16:04 Acenl12

Hi @guidovbrakel , this seems like a network issue to me. Can you check and tell whether the internet is working? Try running this command and share your output:

get --spider google.com

PrakharUniyal avatar Apr 29 '20 22:04 PrakharUniyal

Hi @guidovbrakel , this seems like a network issue to me. Can you check and tell whether the internet is working? Try running this command and share your output:

get --spider google.com

wsl2 internet not working, but wsl1 working fine. I tried reinstalling windows, same issue.

aaemon avatar May 01 '20 15:05 aaemon

Hi,

I removed the Client Hyper-V role and then it started working again. Seems to be conflicting with each other on th network part

Get Outlook for Androidhttps://aka.ms/ghei36

Acenl12 avatar May 02 '20 10:05 Acenl12

Is this issue fixed? Same error for me also. but ping to google.com is working for me.

Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease Connection failed [IP: 2001:67c:1562::15 80] Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease Connection failed [IP: 2001:67c:1562::18 80] Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease Connection failed [IP: 2001:67c:1562::15 80] Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease Connection failed [IP: 91.189.88.142 80] Reading package lists... Done W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Connection failed [IP: 2001:67c:1562::18 80] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Connection failed [IP: 2001:67c:1562::15 80] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Connection failed [IP: 91.189.88.142 80] W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Connection failed [IP: 2001:67c:1562::15 80] W: Some index files failed to download. They have been ignored, or old ones used instead.

================================== ping google.com PING google.com(maa05s03-in-x0e.1e100.net (2404:6800:4007:80d::200e)) 56 data bytes 64 bytes from maa05s03-in-x0e.1e100.net (2404:6800:4007:80d::200e): icmp_seq=1 ttl=54 time=93.8 ms 64 bytes from maa05s03-in-x0e.1e100.net (2404:6800:4007:80d::200e): icmp_seq=2 ttl=54 time=129 ms

dhikrahashim avatar May 10 '20 00:05 dhikrahashim

Is this issue fixed? Same error for me also. but ping to google.com is working for me.

Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease Connection failed [IP: 2001:67c:1562::15 80] Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease Connection failed [IP: 2001:67c:1562::18 80] Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease Connection failed [IP: 2001:67c:1562::15 80] Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease Connection failed [IP: 91.189.88.142 80] Reading package lists... Done W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Connection failed [IP: 2001:67c:1562::18 80] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Connection failed [IP: 2001:67c:1562::15 80] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Connection failed [IP: 91.189.88.142 80] W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Connection failed [IP: 2001:67c:1562::15 80] W: Some index files failed to download. They have been ignored, or old ones used instead.

================================== ping google.com PING google.com(maa05s03-in-x0e.1e100.net (2404:6800:4007:80d::200e)) 56 data bytes 64 bytes from maa05s03-in-x0e.1e100.net (2404:6800:4007:80d::200e): icmp_seq=1 ttl=54 time=93.8 ms 64 bytes from maa05s03-in-x0e.1e100.net (2404:6800:4007:80d::200e): icmp_seq=2 ttl=54 time=129 ms

Yes for me it's fixed.

Acenl12 avatar May 10 '20 16:05 Acenl12

I have the exact same issue - how did you fix it @guidovbrakel?

jameshfisher avatar May 20 '20 11:05 jameshfisher

@jameshfisher Did the issue get fix for you. Even I am facing same problem.

DipanjaliNaik avatar Aug 20 '20 12:08 DipanjaliNaik

@jameshfisher @aaemon @dhikrahashim @PrakharUniyal guys I have fix here. Just while running apt-get update or something just add -o Acquire::ForceIPv4=true something like: apt-get update -o Acquire::ForceIPv4=true but to solve this problem permanently create a file with 99force-ipv4 in /etc/apt/apt.conf.d/ directory and add following stuff: Acquire::ForceIPv4 "true";

mrcat323 avatar Sep 08 '20 08:09 mrcat323

run this command doesn't work for me

apt-get update -o Acquire::ForceIPv4=true

khairaf avatar Sep 15 '20 13:09 khairaf

In my case it was the problem related to the configuration of the /etc/apt/sources.list. All the packages was configured for https and when i visited http://91.189.91.39/ over Firefox i realized that this site does not support https at all. then i changed to some other mirror any that support https i.e. from the list below and it all worked. https://launchpad.net/ubuntu/+archivemirrors

courteous avatar Dec 20 '20 18:12 courteous

Checkout my comment: maybe it helps: https://github.com/microsoft/WSL/issues/5061#issuecomment-756457106

eldano1995 avatar Jan 08 '21 20:01 eldano1995

In my case it was the problem related to the configuration of the /etc/apt/sources.list. All the packages was configured for https and when i visited http://91.189.91.39/ over Firefox i realized that this site does not support https at all. then i changed to some other mirror any that support https i.e. from the list below and it all worked. https://launchpad.net/ubuntu/+archivemirrors

Thank you. This solution work for me.

lbiru avatar Feb 03 '21 06:02 lbiru

In my case it was the problem related to the configuration of the /etc/apt/sources.list. All the packages was configured for https and when i visited http://91.189.91.39/ over Firefox i realized that this site does not support https at all. then i changed to some other mirror any that support https i.e. from the list below and it all worked. https://launchpad.net/ubuntu/+archivemirrors

After applying various solutions available in google for the whole day, this is the one worked for me. Thank you so much.

Rajkgokeda avatar May 21 '21 06:05 Rajkgokeda

i had same issue and resolve with disabling my anti virous application( symantec endpoint )

thiskian avatar Jul 12 '21 10:07 thiskian

i had same issue and resolve with disabling my anti virous application( symantec endpoint )

This works for me. Thanks

ElAmen avatar Jan 01 '22 20:01 ElAmen

i had same issue and resolve with disabling my anti virous application( symantec endpoint )

This worked for me thanks for sharing!

krogge-obando avatar Jan 19 '22 00:01 krogge-obando

disabling the symantec end protection anti virus resolved the issue for me. I had the same issue that internet was on and DNS was configured but still I was unable to connect to the repos of Ubuntu

Edit: After disabling the antivirus, the issue got solved for a while but then again the issue persists, ultimately, I have deleted the antivirus and checking the response

fahadmeraj avatar Feb 07 '22 06:02 fahadmeraj

disabling the antivirus is definitely not recommended - find another way

serup avatar Mar 03 '22 15:03 serup

In my case it was the problem related to the configuration of the /etc/apt/sources.list. All the packages was configured for https and when i visited http://91.189.91.39/ over Firefox i realized that this site does not support https at all. then i changed to some other mirror any that support https i.e. from the list below and it all worked. https://launchpad.net/ubuntu/+archivemirrors

After applying various solutions available in google for the whole day, this is the one worked for me. Thank you so much.

Can you please help me to get through all of this steps :( I am so new here. I need wsl2 badly, I am stuck with this problem for about more than 6 month. Please.

IAmTahazzot avatar Apr 18 '22 03:04 IAmTahazzot

I had the same issue and was resolved by editing

/etc/apt/sources.list

I replaced all

http://xx.archive.ubuntu.com/ubuntu... with http://archive.ubuntu.com/ubuntu ...

and it worked out.

You can try it

fnhirwa avatar May 29 '22 10:05 fnhirwa