从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的内部版本是19041,今天已安装。
WSL2的解决方案了吗?问候
从WSL升级到WSL2后,在wsl --set-version Ubuntu-18.04 2之后sudo apt-get update不再起作用输出:> sudo apt-get update错误:1 http://security.ubuntu.com/ubuntu ...
[很有可能,发行版有其自己的虚拟适配器,首先您可以尝试一些步骤:
生成的文件/etc/resolv.conf是: