运行“代码”。在 wsl 的终端中产生错误

Har*_*ano 10 ubuntu visual-studio-code wsl-2

我最近安装了 wsl 并code .在终端中运行时收到此错误:

\n
Updating VS Code Server to version f80445acd5a3dadef24aa209168452a3d97cc326\nRemoving previous installation...\nInstalling VS Code Server for x64 (f80445acd5a3dadef24aa209168452a3d97cc326)\nDownloading: 100%\nFailed\n--2022-03-01 20:19:21--  https://update.code.visualstudio.com/commit:f80445acd5a3dadef24aa209168452a3d97cc326/server-linux-x64/stable\nResolving update.code.visualstudio.com (update.code.visualstudio.com)... 40.64.128.224\nConnecting to update.code.visualstudio.com (update.code.visualstudio.com)|40.64.128.224|:443... connected.\nHTTP request sent, awaiting response... 302 Found\nLocation: https://az764295.vo.msecnd.net/stable/f80445acd5a3dadef24aa209168452a3d97cc326/vscode-server-linux-x64.tar.gz [following]\n--2022-03-01 20:19:25--  https://az764295.vo.msecnd.net/stable/f80445acd5a3dadef24aa209168452a3d97cc326/vscode-server-linux-x64.tar.gz\nResolving az764295.vo.msecnd.net (az764295.vo.msecnd.net)... failed: Temporary failure in name resolution.\nwget: unable to resolve host address \xe2\x80\x98az764295.vo.msecnd.net\xe2\x80\x99\nERROR: Failed to download https://update.code.visualstudio.com/commit:f80445acd5a3dadef24aa209168452a3d97cc326/server-linux-x64/stable to /home/burbanox/.vscode-server/bin/f80445acd5a3dadef24aa209168452a3d97cc326-1646176740.tar.gz\n
Run Code Online (Sandbox Code Playgroud)\n

我需要知道如何解决它才能打开 Visual Studio Code

\n

Har*_*ano 8

我设法找到了一个有点正统的解决方案

  1. 首先通过windows本地打开Vscode
  2. 转到上半部分的“查看”并选择“命令调色板”
  3. 选择选项“远程 WSL:新 WSL 窗口”


小智 6

wget:无法解析主机地址 \xe2\x80\x98az764295.vo.msecnd.net\xe2\x80\x99\n尝试以下操作:

\n
sudo nano /etc/resolv.conf\n
Run Code Online (Sandbox Code Playgroud)\n

将名称服务器编辑为 8.8.8.8:

\n
nameserver 8.8.8.8\n
Run Code Online (Sandbox Code Playgroud)\n