运行“代码”。在 wsl 的终端中产生错误
我最近安装了 wsl 并在终端中运行 code .
我收到此错误:
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
我需要知道如何解决它才能打开 Visual Studio Code
I recently installed wsl and running 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我有完全相同的问题。
解决方案:
转到搜索栏并输入“打开或关闭 Windows 功能”,
向下滚动到适用于 Linux 的 Windows 子系统,然后取消选中它。
重新启动
返回到“打开或关闭 Windows 功能”(也可以位于控制面板中),然后重新选中“适用于 Linux 的 Windows 子系统”复选框
重新启动
现在您可以打开命令提示符并键入:
打开 Ubuntu 命令行并尝试重新键入 (
code .
),它应该会安装正确的软件包。在此之后,一切又开始为我工作了。回顾:只需禁用并重新启用适用于 Linux 的 Windows 子系统功能即可。
I had the exact same issue.
Solution:
Go to the search bar and type "Turn windows features on or off",
scroll down to Windows Subsystem for Linux, and uncheck it.
Restart
Go back to "Turn windows features on or off", which can also be located in the control panel, and recheck the box for Windows Subsystem for Linux
Restart
Now you can open to command prompt and type:
Open your Ubuntu command line and try retyping (
code .
) and it should install the proper packages.Following this, everything was working for me again. Recap: Just disable and re-enable the Windows Subsystem for Linux feature.
经过恢复发现,我找到了解决这个问题的方法:
这对我有用。
After recovery found, I found a solution to this problem:
It worked for me.
我按照此处的步骤修复网络问题,效果很好然后。
I followed the steps here to fix the networking issue and it works fine afterwards.
这与代理有关,但请始终确保尝试重新启动笔记本电脑,然后运行 sudo update 和 sudo update ,检查代理,然后打开终端并输入代码。
This is related to proxy but always make sure you try to reboot the laptop, then run
sudo update
andsudo upgrade
, check the proxy then open the terminal and typeCODE
.我设法找到了一个有点正统的解决方案
I managed to find a somewhat orthodox solution
Ctrl + Shift + p
WSL
并选择选项WSL:使用 Distro 连接到 WSL
Ubuntu-22.04
现在,如果您尝试使用 WSL 命令
code .
,它应该可以工作。在我看来,这似乎是 WSL 中的网络问题。通过执行上述步骤,vscode 从 Windows 端而不是从之前失败的 WSL 内部进行更新。
Ctrl + Shift + p
WSL
and select optionWSL: connect to WSL using Distro
Ubuntu-22.04
Now if you try command
code .
from WSL it should work.This seems to me a network issue in WSL. By doing the above steps, the vscode gets updated from the windows side instead from inside WSL which was failing previously.
wget:无法解析主机地址“az764295.vo.msecnd.net”
试试这个:
将名称服务器编辑为 8.8.8.8:
wget: unable to resolve host address ‘az764295.vo.msecnd.net’
try this :
edit name server to 8.8.8.8: