【Linux】在WSL中遇到的网络问题 Temporary failure resolving

avatar

azurekiln

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服务器问题。
  • 解决方法:
    1. 打开并编辑 /etc/resolv.conf 文件:
      sudo nano /etc/resolv.conf
    2. 添加可以正常工作的DNS服务器(如Google DNS):
      nameserver 8.8.8.8
      nameserver 8.8.4.4
    3. 保存后再次执行:
      sudo apt update

扫描二维码,在手机上阅读
收藏
请先 登录 再评论
powered by emlog pro
服务器供应商 景云数据

友情链接
白衣Ink


sitemap