-4

when im trying to running sudo apt update it get this

Err:1 http://security.ubuntu.com/ubuntu focal-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu focal InRelease
  Temporary failure resolving 'archive.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
Building dependency tree
Reading state information... Done
All packages are up to date.
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.

can anyone help me? im using windows 10, amd and wsl 2

sia
  • 11
  • 2
  • 1
    how is this different to the question you already asked [here](https://askubuntu.com/questions/1346288/sudo-apt-update-error) 10 minutes previously which has an answer? – graham Jun 16 '21 at 15:18
  • @sia you have some problem with the *internet connection*. I have no clue about wsl 2 so i cannot help. – AlexOnLinux Jun 16 '21 at 20:01

1 Answers1

0

DNS resolution error is quite common in WSL2

So execute the below commands

echo "[network]" | sudo tee /etc/wsl.conf
echo "generateResolvConf = false" | sudo tee -a /etc/wsl.conf
sudo rm -Rf /etc/resolv.conf
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf 
sudo chattr +i /etc/resolv.conf