如何在Linux离线版中安装vscode-server

时间:2019-06-19 15:43:36

标签: visual-studio-code

我正在尝试安装VScode remote-ssh扩展,但是我的远程主机无法连接到Internet,因此没有必要下载软件。 所以我收到了这样的错误消息:

SSH Resolver called for "ssh-remote+kf"
SSH Resolver called for host: kf
Setting up SSH remote "kf"
Using commit id "daf71423252a707b8e396e8afa8102b717f8213b" and quality "insider" for server
Install and start server if needed
> bash: no job control in this shell
> Installing...
> Downloading with wget
> ERROR: certificate common name “*.azurewebsites.net” doesn’t match requested host name “update.code.visualstudio.com”. To connect to update.code.visualstudio.com insecurely, use ‘--no-check-certificate’.
> 2b948abc-b874-4ef5-875a-a29370a5f844##25##
"install" terminal command done
Received install output: 2b948abc-b874-4ef5-875a-a29370a5f844##25##
Server download failed
Downloading VS Code Server failed. Please try again later.

如何解决此问题?

1 个答案:

答案 0 :(得分:2)

  1. 首先获取提交ID
  2. 从以下网址下载vscode服务器:https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable
  3. vscode-server-linux-x64.tar.gz上载到服务器
  4. 在没有vscode-server-linux-x64目录的情况下将下载的vscode-server-linux-x64.tar.gz解压缩到~/.vscode-server/bin/${commit_id}
  5. 0下创建~/.vscode-server/bin/${commit_id}文件
commit_id=f06011ac164ae4dc8e753a3fe7f9549844d15e35

# Download url is: https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable
curl -sSL "https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable" -o vscode-server-linux-x64.tar.gz

mkdir -p ~/.vscode-server/bin/${commit_id}
# assume that you upload vscode-server-linux-x64.tar.gz to /tmp dir
tar zxvf /tmp/vscode-server-linux-x64.tar.gz -C ~/.vscode-server/bin/${commit_id} --strip 1
touch ~/.vscode-server/bin/${commit_id}/0