今天在wsl ubuntu里面运行code. 的时候报下面的错误信息

root@DESKTOP-68F1OMN:/data/tencent/weda# code .
Updating VS Code Server to version 848b80aeb52026648a8ff9f7c45a9b0a80641e2e
Removing previous installation...
Installing VS Code Server for Linux x64 (848b80aeb52026648a8ff9f7c45a9b0a80641e2e)
Downloading: 100%
Failed
--2025-06-01 12:01:53--  https://update.code.visualstudio.com/commit:848b80aeb52026648a8ff9f7c45a9b0a80641e2e/server-linux-x64/stable
Resolving update.code.visualstudio.com (update.code.visualstudio.com)... 13.107.246.50, 2620:1ec:bdf::50
Connecting to update.code.visualstudio.com (update.code.visualstudio.com)|13.107.246.50|:443... connected.
ERROR: cannot verify update.code.visualstudio.com's certificate, issued by ‘CN=Microsoft Azure RSA TLS Issuing CA 08,O=Microsoft Corporation,C=US’:
  Self-signed certificate encountered.
To connect to update.code.visualstudio.com insecurely, use `--no-check-certificate'.
ERROR: Failed to download https://update.code.visualstudio.com/commit:848b80aeb52026648a8ff9f7c45a9b0a80641e2e/server-linux-x64/stable to /root/.vscode-server/bin/848b80aeb52026648a8ff9f7c45a9b0a80641e2e-1748750512.tar.gz
Please install missing certificates.
Debian/Ubuntu:  sudo apt-get install ca-certificates

        由于我的ubuntu无法认证SSL导致下载失败

最后解决方法如下

wget https://update.code.visualstudio.com/commit:848b80aeb52026648a8ff9f7c45a9b0a80641e2e/server-linux-x64/stable -O vscode-server.tar.gz
mkdir -p ~/.vscode-server/bin/848b80aeb52026648a8ff9f7c45a9b0a80641e2e
tar -xzf vscode-server.tar.gz -C ~/.vscode-server/bin/848b80aeb52026648a8ff9f7c45a9b0a80641e2e --strip-components=1

在运行

code .

可以重新使用VS Code了

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐