当我在 PowerShell 或 Windows 终端中打开 Ubuntu 并输入“代码”时,它只是说正在更新,然后失败了:
code
输出:
Updating VS Code Server to version a6606b6ca720bca780c2d3c9d4cc3966ff2eca12
Removing previous installation...
Installing VS Code Server for x64 (a6606b6ca720bca780c2d3c9d4cc3966ff2eca12)
Downloading: 100%
Failed
--2024-03-08 14:30:17-- https://update.code.visualstudio.com/commit:a6606b6ca720bca780c2d3c9d4cc3966ff2eca12/server-linux-x64/stable
Resolving update.code.visualstudio.com (update.code.visualstudio.com)... 13.107.246.55, 13.107.213.55, 2620:1ec:bdf::55, ...
Connecting to update.code.visualstudio.com (update.code.visualstudio.com)|13.107.246.55|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-03-08 14:30:18 ERROR 404: Not Found.
ERROR: Failed to download https://update.code.visualstudio.com/commit:a6606b6ca720bca780c2d3c9d4cc3966ff2eca12/server-linux-x64/stable to /home/adduser/.vscode-server/bin/a6606b6ca720bca780c2d3c9d4cc3966ff2eca12-1709901016.tar.gz
我尝试在 WSL 2 上安装 Visual Studio Code,因为 Odin 项目 告知我他们并不真正支持 Windows 作为操作系统。因此,我安装了 WSL 和 Ubuntu,但无法在 WSL 上安装 Visual Studio Code(我已经在 Windows 上安装了 Visual Studio Code)。
使用网络浏览器,我还尝试了系统上提供的错误消息的下载 URL,并且我在该文件上收到了 404“未找到”。
显然,您不是第一个遇到此特定问题的人。 vscode-remote-server
上的
问题 #9214显示相同的提交哈希无法下载。
微软 VSCode 开发人员的回复是:
a6606b6ca720bca780c2d3c9d4cc3966ff2eca12 不是官方发布版本 - 似乎您可能最终以某种方式结束了私人版本?您使用的版本也已过时,因此更新或卸载/重新安装应该可以修复它
卸载VSCode本身,直接从微软下载安装程序,然后重新安装。
正如评论中提到的,if在你的Linux主目录中有一个
~/.vscode-server
,那么为了更好的措施,我也会删除或重命名它。