如何在Linux下离线安装vscode-server[重复]

问题描述 投票:0回答:1

我正在尝试安装 VScode 远程 ssh 扩展,但我的远程主机无法连接到互联网,因此无法下载软件。 所以我收到了一些类似的错误消息:

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.

我该如何解决这个问题?

visual-studio-code
1个回答
120
投票
  1. 首先获取commit 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.tar.gz
    解压到
    ~/.vscode-server/bin/${commit_id}
    ,无需使用vscode-server-linux-x64目录
  5. 0
    下创建
    ~/.vscode-server/bin/${commit_id}
  6. 文件
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}
tar zxvf vscode-server-linux-x64.tar.gz -C ~/.vscode-server/bin/${commit_id} --strip 1
touch ~/.vscode-server/bin/${commit_id}/0

- 或 -

请参阅 dl-vscode-server 了解更完整的 shell 脚本,该脚本还将获取最新发布的提交 SHA(来自 GitHub),因此您无需自己提供。

Gist download-vs-code-server 现在应该被视为已存档,因为它已移至 GitHub 上的正式存储库。


[编辑添加有用的评论,以防评论稍后消失:]

您可以将

commit:<commit>
替换为
latest
以获得最新版本。例如:
https://update.code.visualstudio.com/latest/server-linux-x64/stable
。尊重表明质量,即
stable
insider
。 – 毁灭战士5

© www.soinside.com 2019 - 2024. All rights reserved.