Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WSL2] Internet Connectivity Issue with WSL version 2 (Ping working, but not apt update and others) #5976

Closed
kunalsuri opened this issue Sep 23, 2020 · 8 comments

Comments

@kunalsuri
Copy link

kunalsuri commented Sep 23, 2020

Environment

Windows build number: Microsoft Windows [version 10.0.18363.1110] 
Your Distribution version: Ubuntu 18.04 on WSL 2
Your Distribution version: Ubuntu 20.04 on WSL 1 
Whether the issue is on WSL 2 and/or WSL 1: Internet connectivity issue with linux on WSL 2

Steps to reproduce

NOTE: I am new to the usage of WSL and thus with the release of WSL 2, I got excited and decided to try WSL.

I manually installed Ubuntu 18.04 (on WSL 2) and Ubuntu 20.04 ( on WSL 1) (as my corporate laptop has MS Store disabled). I followed official MS docs to perform such installations

Issue with Ubuntu 18.04 on WSL 2

  • I am able to ping external websites such as Google.com
  • I am NOT able to perform "sudo apt update"

Possible that issue is similar to issues #5971, #5867...

WSL logs:
$ ping google.com -c 4
PING google.com (172.217.19.238) 56(84) bytes of data.
64 bytes from par21s11-in-f14.1e100.net (172.217.19.238): icmp_seq=1 ttl=114 time=5.62 ms
64 bytes from par21s11-in-f14.1e100.net (172.217.19.238): icmp_seq=2 ttl=114 time=5.11 ms
64 bytes from par21s11-in-f14.1e100.net (172.217.19.238): icmp_seq=3 ttl=114 time=5.13 ms
64 bytes from par21s11-in-f14.1e100.net (172.217.19.238): icmp_seq=4 ttl=114 time=5.17 ms

--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 5.116/5.261/5.624/0.210 ms

$ sudo apt update
Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
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:1562::15). - connect (101: Network is unreachable) 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:1360:8001::23). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out
Err:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
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:1562::15). - connect (101: Network is unreachable) 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:1360:8001::23). - 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:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) 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:1360:8001::23). - 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:1562::18). - connect (101: Network is unreachable) 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: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.88.152), 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.91.39), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease 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:1562::15). - connect (101: Network is unreachable) 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:1360:8001::23). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.152), 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:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) 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:1360:8001::23). - 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:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) 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:1360:8001::23). - 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:1562::18). - connect (101: Network is unreachable) 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: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.88.152), 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.91.39), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.

Expected behavior

Ubuntu 18.04 on WSL 2

  • I am able to ping external websites such as Google.com
  • I am able to perform "sudo apt update" and others installs

Actual behavior

Ubuntu 18.04 on WSL 2

  • I am able to ping external websites such as Google.com
  • I am NOT able to perform "sudo apt update"

Steps done for testing

Step1: For testing purpose, I kept the Ubuntu 20.04 on WSL 1
Everything works fine

  • I am able to perform "sudo apt update" and other installs such as gcc
  • I am able to ping external websites such as Google.com

Step2: I update the same Ubuntu 20.04 to WSL 2 via wsl --set-version Ubuntu-20.04 2
Failure starts

  • I am able to ping external websites such as Google.com
  • I am NOT able to perform "sudo apt update"

Step3: I update the same Ubuntu 20.04 back to WSL 1 via wsl --set-version Ubuntu-20.04 1
Everything starts working again

  • I am able to ping external websites such as Google.com
  • I am able to perform "sudo apt update" and other installs such as gcc

Steps taken based on other error reports and updates

In Ubuntu 18.04 (on WSL 2), I followed various solutions given in different bug reports. For Instance,

Unfortunately, still there is no way to connect Ubuntu 18.04 on WSL 2 to update sites (via apt update)

@walter-weinmann
Copy link

I have the same problem with WSL2 and Ubuntu 20.04. The combination of WSL2 and Ubuntu is pretty useless if you can't install software.

@therealkenc
Copy link
Collaborator

/dupe #5971, #5867

@ghost
Copy link

ghost commented Sep 24, 2020

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

@ghost ghost closed this as completed Sep 24, 2020
@ghost ghost added the duplicate label Sep 24, 2020
@microsoft microsoft deleted a comment from Fagbemi-Jeremiah Sep 24, 2020
@odyright
Copy link

odyright commented Oct 4, 2020

Always the same issue, and each time you put the label "duplicate", but when we refer to the post in question, there is no appropriate or concrete solution. It gets boring and frustrating.
ver Microsoft Windows [version 10.0.19041.508] + wsl2 Ubuntu 20.04

@walter-weinmann
Copy link

WSL2 is a very frustrating product

@eldano1995
Copy link

Checkout my comment: maybe it helps: #5061 (comment)

@jouhoff
Copy link

jouhoff commented Sep 18, 2021

Store page states that updates do not function. For updates we should use do-release-upgrade but that can't be right ....

@mikyll
Copy link

mikyll commented Jun 2, 2024

Might sound extremely dumb, but I was able to solve this by turning off the mobile hotspot.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants