【Linux】在WSL中遇到的网络问题 Temporary failure resolving
W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/noble-security/InRelease Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
W: Failed to fetch https://mirrors.aliyun.com/ubuntu/dists/noble/InRelease Temporary failure resolving 'mirrors.aliyun.com'
W: Failed to fetch https://mirrors.aliyun.com/ubuntu/dists/noble-updates/InRelease Temporary failure resolving 'mirrors.aliyun.com'
W: Failed to fetch https://mirrors.aliyun.com/ubuntu/dists/noble-security/InRelease Temporary failure resolving 'mirrors.aliyun.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
关键错误提示:
Temporary failure resolving 'archive.ubuntu.com'
- 原因:WSL DNS服务器问题。
- 解决方法:
- 打开并编辑 /etc/resolv.conf 文件:
sudo nano /etc/resolv.conf
- 添加可以正常工作的DNS服务器(如Google DNS):
nameserver 8.8.8.8 nameserver 8.8.4.4
- 保存后再次执行:
sudo apt update
- 打开并编辑 /etc/resolv.conf 文件:
扫描二维码,在手机上阅读
收藏