ubuntu装essential(gcc)时temporary failure in name resolution解决方案
改DNS即可
1查看DNS
vi /etc/resolv.conf
2在原DNS后加
nameserver 114.114.114.114
nameserver 8.8.8.8
3重装
sudo apt-get install build-essential
装载时出现需要更新提示
Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
只需更新即可
sudo apt-get update
4检查是否安装成功
gcc --version
参考
Ubuntu apt-get install出现“Temporary failure resolving 'cn.archive.ubuntu.com'”_奔狼-CSDN博客
-----------------------------------------------------------------------------------------------------
2022.5.2更新
彻底解决DNS问题
参考
重新夺回对 /etc/resolv.conf 的控制权 - 云+社区 - 腾讯云 (tencent.com)
注意vim resolv.conf的时候用管理员模式
---------------------------------------------------------------------------------------------------------
2022.7.21
改DNS还是不行
管理员打开poweshell : wsl --shutdown
重启即可

浙公网安备 33010602011771号