5
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://security.ubuntu.com/ubuntu focal-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

Above is the error I receive every time I attempt to update Ubuntu. I have Ubuntu from the microsoft store, it's the one with no version listed in the title. Since I can't update, I am also unable to get gcc, make, etc as well. I receive the same error each time.

Any tips or advice is appreciated. Thanks in advance.

UPDATE (May 4 2021): The solution is to type

echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null

into the terminal. It adds a nameserver (specifically Google's server) so everything can connect and update. Immediately after doing this I was able to successfully update the files and download gcc, make, and other files using sudo apt -get.

1 Answers1

1

I had the same problem when using a VPN.

The solution was to disable the WSL adapter before connecting to the VPN:

  1. Disconnect and close client VPN

  2. Launch WSL

  3. ping google.com - It should be working

  4. In a PowerShell, disable WSL adapter:

    netsh interface set interface "vEthernet (WSL)" disable
    
  5. Connect to your VPN client

  6. Enable the WSL adapter

    netsh interface set interface "vEthernet (WSL)" enable
    
  7. ping google -- it should work and you can do your apt command

NotTheDr01ds
  • 22,082
sadati boina
  • 111
  • 2