gpt4 book ai didi

ubuntu - Windows10 WSL2 Ubuntu/Debian # 无网络

转载 作者:行者123 更新时间:2023-12-04 04:27:39 25 4
gpt4 key购买 nike

从 WSL 升级到 WSL2 后

sudo apt-get update
不再工作。后: wsl --set-version Ubuntu-18.04 2输出是:
> sudo apt-get update
Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
回到 WSL1 后,问题再次消失。在 Debian 上也是如此,在 CentOS 上也是如此。所以 WSL2 一定有一个错误。
Windows10 build 版本为 19041,今天安装。
WSL2 的任何解决方法?
问候

最佳答案

生成的文件/etc/resolv.conf 是:

nameserver 172.24.0.1



..必须将其更改为

nameserver 8.8.8.8



这解决了问题

关于ubuntu - Windows10 WSL2 Ubuntu/Debian # 无网络,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60269422/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com