-
Notifications
You must be signed in to change notification settings - Fork 797
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
Updates don't work on WSL2 #5061
Comments
Same issue for me also. Just installed ubuntu 18.04. not able to update |
The problem is resolved after reinstalling on ubuntu 20.04. Winver 19041.208 |
okay |
I have the same issue with Windows 19041.264 |
If I revert back to WSL 1 everything works, just WSL 2 doesn't connect |
@rromanv Try something like |
This works, that mean I have issues with DNS resolving? |
I followed up this, but instead of Google DNS I pointed to my company DNS (I need resolve of internal services/servers) |
Yes, that looks like DNS problem. You can see plenty of threads with similar issues but not an universal solution. |
i have the same issue when i'm connected over WiFi however i noticed that when i'm connected over ethernet it works well. i think issue is related to sharing network process between network cards over Hyper-v engine. WSL2 is not an emulation anymore but a specific hyper-v virtual machine that uses same network connexions that an hyper-v vm to connect (like virtual switch)... |
I turned off my VPN and I did not have an issue updating. |
Tried everything, still can't get it to work. It works in WSL 1 but not 2. |
Turning off my VPN fixed the issue for me as well. |
Same..
But, if i try to connect over Ethernet, or through my phone's wifi (routing), it works |
It magically worked after this |
I had Same problem with WSL2 , ubuntu distro. Basically you are not able to reach ubuntu servers on TCP connection. |
Turning off public network firewall solved it temporarily. Making the following firewall rule, in powershell, solved it completely:
|
Not a PS expert here.. |
Makes a new windows firewall rule that allows the standard WSL interface to receive inbound packets (=> internet connection). Copy and paste it in the PowerShell admin console, after if you open Windows Firewall you will see the new created rule |
@P1100 The rule didnt work for me.. The only thing that works until now is run terminal evidence❯ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 https://dl.yarnpkg.com/debian stable InRelease
Err:3 http://security.ubuntu.com/ubuntu focal-security InRelease
Connection failed [IP: 91.189.91.39 80]
Err:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Connection failed [IP: 91.189.88.152 80]
Err:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Connection failed [IP: 91.189.88.152 80]
Reading package lists... Done
Building dependency tree
Reading state information... Done
61 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease Connection failed [IP: 91.189.88.152 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease Connection failed [IP: 91.189.88.152 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease Connection failed [IP: 91.189.91.39 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
❯ sudo ifconfig eth0 mtu 1350
❯ sudo apt update
Hit:1 https://dl.yarnpkg.com/debian stable InRelease
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [338 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [4992 B]
Get:7 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [507 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]
Get:9 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [63.4 kB]
Get:10 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [8500 B]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [610 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [10.3 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [669 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [12.0 kB]
Fetched 2540 kB in 2s (1144 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
63 packages can be upgraded. Run 'apt list --upgradable' to see them. |
#5061 (comment) -> Solution is working for me. |
I can't update too. |
Running a brand new install of windows 11 with focal on wsl2 I ran into this issue. I tried to:
The snapd install should not be breaking networking or updates; snapd is poorly designed bloatware if that is happening. |
windows10 + wsl2 ran into this issue. it can work : change /etc/resolv.conf
|
I don't know if this was posted but I solved it in this way: add in
on Windows 10 Pro + WSL2 |
Windows 10 Home + WSL2 Able to ping IPs and hosts OK (so resolving OK) however apt update kept failing. Came off my Wireguard VPN and it worked fine (so not an AV issue) - can't quite understand why connectivity part working. |
change the mtu of eth0 to 1350. It works for me. |
Checking all the steps suggested like change 8.8.8.8, adding the wsl.conf , adding the .wslconfig, or disable the firewall and antivirus doesn't work. (I was thinking to go to reinstall a new windows 11 version lol) but I tried one more time.
|
In my case, I switched to a different isp, and update worked well. After update, I went back to my first network and everything was working well. |
Thank you. |
This worked for me. Before the change, eth0 was 1500. |
The instruction here worked for me:
|
It also works for me |
I installed Ubuntu-20.04 so for me it was: (from powershell)
appreciate the fix bro |
I reverted to wsl1 and I am getting error at: sudo apt update |
sudo curl -fsSLo /etc/apt/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg sudo apt update && sudo apt upgrade from kubernetes/release#1982 (comment) but still getting error |
|
yea same for me |
Hi, I tried everything but that worked |
just had the same issue and this fixed it thanks :) |
Tragedy of 3 years. please rewrite WSL |
I can't believe this is not already fixed |
For my case, my system was wrong with date/time. Probably when More info: #4114 |
Hello all, I've just get same error using two different AV software. Adding bash.exe and wsl.exe to the AV whitelist resolve this problem as described in this StackOverflow thread: Link. Basically all you need to do is whitelist in firewall software (or firewall module of AV) two files - bash.exe and wsl.exe located in C:\Windows\System32 then restart PC and it's should be working. Alternative way is to launch installed distribution as a administrator. I hope this helps someone. |
My problem was that my DNS was messed up. I fixed this by switching to Google's DNS server:
After making this change, |
wsl --set-version Ubuntu 1 worked for me, win 10 home WSL2 |
Hi ! Please try the latest networking features that we've added in WSL. Those should greatly improve networking. If the issue still remains, please reopen this issue. |
Hi guys!
After changing the version of WSL:
PS C:\WINDOWS\system32> wsl --set-version Ubuntu 2
Apt update doesn't work for me (and I waited for the execution of this command for about half an hour, why so long?...):
And release upgrade too:
In this case, everything responds:
After the rollback (
wsl --set-version Ubuntu 1
), there is no problem:My system:
Internet connected via PPTP client. And as you can see, the internet works on PC and on WSL. But the updates for some reason do not work ...
I freaked out and reinstalled WSL completely, but it gave me nothing.
The text was updated successfully, but these errors were encountered: