WSL2不能上网:
问题:ping外网无效
例如:ping www.baidu.com失败
解决方案:
在wsl:
$sudo vi /etc/wsl.conf
wsl.conf:
[network]
generateResolvConf = false
在PowerShell:
$sudo vi /etc/etc/resolv.conf
resolv.conf:
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 8.8.8.8
git命令失败
问题:Failed to connect to github.com port 443
解决方案
1.git config --global --list
有代理的,把下面的代理删掉
2.添加下图黄色部分—140.82.114.3 github.com
sudo gedit /etc/hosts