Failed to do apt-get update WSL2 Ubuntu 20 Windows 10

before marking this question as a duplicate, hear me out. I have tried every workaround I could find on internet.

First of all, I am using WSL2 with Ubuntu 20 on Windows 10 Home Edition.

This is what I got when running sudo apt-get update:

Hit:1 ./ InRelease
Hit:2 focal InRelease
Err:3 focal InRelease
  Connection failed [IP: 80]
Err:4 focal InRelease
  Connection failed [IP: 80]
Err:5 focal-updates InRelease
  Connection failed [IP: 80]
Err:6 focal-security InRelease
  Connection failed [IP: 80]
Err:7 focal-backports InRelease
  Connection failed [IP: 80]
Reading package lists... Done
W: Failed to fetch  Connection failed [IP: 80]
W: Failed to fetch  Connection failed [IP: 80]
W: Failed to fetch  Connection failed [IP: 80]
W: Failed to fetch  Connection failed [IP: 80]
W: Failed to fetch  Connection failed [IP: 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.

Things I had done based on answers I found:

  1. Editing the /etc/resolv.conf. People have been successfully fixed this problem by adding nameserver, nameserver, and nameserver And then add [network] generateResolvConf = false to /etc/wsl.conf.
  2. Changing sources.list urls to mirror urls
  3. Disabling firewall and antivirus. In fact, people are pointing out that Avast antivirus is causing them trouble. But I currently don’t have any 3rd party antivirus installed.
  4. Using/disabling VPN

Things that are worth noting:

  1. I can ping,, and pretty much any outside domain from WSL
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=51 time=189 ms
64 bytes from ( icmp_seq=2 ttl=51 time=188 ms
64 bytes from ( icmp_seq=3 ttl=51 time=195 ms
64 bytes from ( icmp_seq=4 ttl=51 time=188 ms

--- ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 188.027/190.212/195.247/2.953 ms
  1. I can ping WSL ip address from host, but cannot do it vice versa (host ip from WSL)
  2. I have docker running on WSL and it works just fine. Funny thing is that previously I had this issue before when docker had a new update but I decided to snooze it. It was fixed when I did the docker update.
  3. I don’t know if this is the actual issue, but a couple days ago I uninstalled McAfee antivirus. I believe the issue started after I did this, but I’m not sure

Source: Windows Questions