[英]Running 'code .' in terminal in wsl produces an error
I recently installed wsl and running code.
我最近安装了 wsl 并运行
code.
in the terminal I get this error:在终端我得到这个错误:
Updating VS Code Server to version f80445acd5a3dadef24aa209168452a3d97cc326
Removing previous installation...
Installing VS Code Server for x64 (f80445acd5a3dadef24aa209168452a3d97cc326)
Downloading: 100%
Failed
--2022-03-01 20:19:21-- https://update.code.visualstudio.com/commit:f80445acd5a3dadef24aa209168452a3d97cc326/server-linux-x64/stable
Resolving update.code.visualstudio.com (update.code.visualstudio.com)... 40.64.128.224
Connecting to update.code.visualstudio.com (update.code.visualstudio.com)|40.64.128.224|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://az764295.vo.msecnd.net/stable/f80445acd5a3dadef24aa209168452a3d97cc326/vscode-server-linux-x64.tar.gz [following]
--2022-03-01 20:19:25-- https://az764295.vo.msecnd.net/stable/f80445acd5a3dadef24aa209168452a3d97cc326/vscode-server-linux-x64.tar.gz
Resolving az764295.vo.msecnd.net (az764295.vo.msecnd.net)... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘az764295.vo.msecnd.net’
ERROR: Failed to download https://update.code.visualstudio.com/commit:f80445acd5a3dadef24aa209168452a3d97cc326/server-linux-x64/stable to /home/burbanox/.vscode-server/bin/f80445acd5a3dadef24aa209168452a3d97cc326-1646176740.tar.gz
I need to know how I can solve it to be able to open visual studio code我需要知道如何解决它才能打开 Visual Studio 代码
I managed to find a somewhat orthodox solution我设法找到了一个有点正统的解决方案
I had the exact same issue.我有完全相同的问题。
Solution: 1> go to search bar and type (Turn windows features on or off) scroll down to windows subsystem for linux and uncheck it. Solution: 1> go to search bar and type (Turn windows features on or off) scroll down to windows subsystem for linux and uncheck it. 2> restart 3> go back to (Turn windows features on or off) #which can also be located in the control panel.
2> 重新启动 3> go 回到(打开或关闭 windows 功能)#也可以位于控制面板中。 and recheck the box for Windows Subsystem for linux 4>restart
并重新选中 Windows 子系统的框 linux 4>重新启动
now you can open to command prompt and type:现在您可以打开命令提示符并键入:
wsl -l -v #this will verify which version you are running.
wsl -l -v #这将验证您正在运行的版本。 mine remained the same at wsl 2. if it is not you can change it.
我的在 wsl 2 上保持不变。如果不是,您可以更改它。 wsl --set-version Ubuntu20.04 2
wsl --set-version Ubuntu20.04 2
5> open your ubuntu command line and try retyping (code.) and it should install the proper packages. 5> 打开您的 ubuntu 命令行并尝试重新输入(代码。)它应该安装正确的包。
taylor@DESKTOP-TI4J8NI:~/Desktop/OS_Python$ code .
Updating VS Code Server to version 3b889b090b5ad5793f524b5d1d39fda662b96a2a
Removing previous installation...
Installing VS Code Server for x64 (3b889b090b5ad5793f524b5d1d39fda662b96a2a)
Downloading: 100%
Unpacking: 100%
Unpacked 2822 files and folders to /home/taylor/.vscode-
server/bin/3b889b090b5ad5793f524b5d1d39fda662b96a2a.
Following this everything was working for me again.在此之后,一切都再次为我工作。 Recap just disable and re-enable the windows subsystem for linux feature.
回顾一下,为 linux 功能禁用并重新启用 windows 子系统。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.