sudo apt-get update in the new Windows Subsystem for Linux, but I get the following error:
The most relevant parts seem to be the "could not resolve" lines about Ubuntu servers, like:
Could not resolve 'archive.ubuntu.com'
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
There is an open GitHub issue about this error.
It appears that the most likely problem is that
/etc/resolv.conf didn't get generated correctly. Make sure it contains a
nameserver line for a valid DNS server, preferably one on your local network. Many routers provide DNS services to their networks; on my network, I would add this line:
If there are entries that don't correspond to valid DNS servers, remove them.
If you use a third-party antivirus product, try disabling its firewall - there are reports that some such programs interfere with Bash's connectivity.
It looks like your DNS settings are incorrect or you could have a gateway/netmask incompatibility.
ip link to verify that an interface is listed as 'up' and then
ifconfig to for the settings of that interface. you may also need to
cat /etc/sysconfig/network-scripts/ifcfg-eth? to look at the settings of the interfaces.
traceroute -d 184.108.40.206 to see if you can reach google's public DNS server. That will verify you are getting out to the outside network.
If it works with
-d but fails to resolve the IP's to names when run without the
-d then a quick fix would be to add 220.127.116.11 & 18.104.22.168 to your DNS Settings for the interface that is up, and then issue a
service network restart to restart the network services and make the DNS changes active.
I forgot if you don't have a gui interface configured yet, you can easily edit the interface configs with
system-config-network. Navigate with arrow keys,tab, esc, and enter
In my case it was Kaspersky. I have given a detailed explanation here: https://github.com/microsoft/WSL/issues/4275#issuecomment-674480761
Contents of the above link:
Apart from adding routes and nameservers, Kapersky was causing the issue for me. Stoping it was not working either probably it was making changes to some system files to prevent access to WSL application. I found this to be helpful:
Go to: More Tools -> Manage Application -> Application Control -> Manage Application -> 'your WSL app name' -> click on network(green arrow) -> Change value to allow.