我目前使用的是 Windows 11 的 Insider 版本。(22458)
然而,我在其他版本上也遇到过几次这个问题。(并且 wsl 之前工作过)
当我启动 wsl 时,我无法执行 DNS 请求。(直接Ping IP地址即可。)
我跟踪这个问题到文件:/etc/resolv.conf
它包括 DNS 服务器地址。
默认为:172.22.192.1
然而,这个不起作用。
如果我将其更改为 1.1.1.1(Cloud Flare DNS),它会再次工作。
但是,每次重新启动 wsl 后,它都会将其更改回默认值。
有一个名为 wsl.conf 的文件,我可以在其中禁用生成此文件,但如果总是在每次重新启动后完全删除该文件。
那么我该如何解决这个问题呢?
我的第一个想法是完全重置 wsl,但既没有重置应用程序,也没有通过功能重新安装 WSL 修复它。
有人知道该怎么做吗?
所以我想在 Ubuntu 的 WSL2 中安装 Firefox。现在,使用
sudo apt install firefox
Run Code Online (Sandbox Code Playgroud)
给我这个输出:
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
firefox
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 72.3 kB of archives.
After this operation, 261 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 firefox amd64 1:1snap1-0ubuntu2 [72.3 kB]
Fetched 72.3 kB in 0s (420 kB/s)
Preconfiguring packages ...
Selecting previously unselected …
Run Code Online (Sandbox Code Playgroud) apt firefox software-installation snap windows-subsystem-for-linux