Skip to content

when trying to install nvm with wsl-2 it throws (6) Could not resolve host: raw.githubusercontent.com #3963

Answered by mattjaf
mattjaf asked this question in Q&A
Discussion options

You must be logged in to vote

you can try running this

sudo rm /etc/resolv.conf
sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
sudo bash -c 'echo "[network]" > /etc/wsl.conf'
sudo bash -c 'echo "generateResolvConf = false" >> /etc/wsl.conf'
sudo chattr +i /etc/resolv.conf

it deletes your resolve.config file thats automatically generated when u run WSL then creates a new file and puts "nameserver 8.8.8.8", then creates a wsl.conf file and adds [network] and generateResolveConf = false to prevent auto generation of that file

you can also run

cat /etc/resolv.conf

to check the contents of the file

then

ping google.com

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mattjaf
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants