Temporary failure in name resolution域名解析錯誤Failed to fetch...導致Ubuntu無法更新(WSL2)
阿新 • • 發佈:2021-01-13
sudo apt-get update
sudo apt-get upgrade
#錯誤
錯誤:Failed to fetch... Temporary failure in name resolution
原因分析是:DNS伺服器無法正確解析
解決方法:
sudo rm -f /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
reboot
WSL2中重啟辦法
開啟powershell輸入 wsl.exe --shutdown
然後輸入wsl.exe重啟後嘗試成功。