【问题标题】:How can I install vscode-server in linux offline [duplicate]如何在 linux 中离线安装 vscode-server [重复]
【发布时间】:2019-06-19 15:43:36
【问题描述】:

我正在尝试安装 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.

我该如何解决这个问题?

【问题讨论】:

    标签: visual-studio-code


    【解决方案1】:
    1. 首先获取提交 ID
    2. 从url下载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. ~/.vscode-server/bin/${commit_id}下创建0文件
    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
    

    - 或 -

    请参阅此 Gist download-vs-code-server 以获得更完整的 shell 脚本,该脚本还将获得最新发布的提交 SHA(来自 GitHub),因此您无需自己提供。


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

    您可以将commit:<commit> 替换为latest 以获取最新版本。示例:https://update.code.visualstudio.com/latest/server-linux-x64/stable。尊重表示质量,即stableinsider。 – Doom5

    【讨论】:

    • 谢谢!还有一个问题:如果将来有可用的扩展程序,我该如何升级?
    • 是的,但是一旦有更新,我怎样才能获得最新的 ${commit_id}?顺便说一句,我为此创建了一个问题,github.com/microsoft/vscode-remote-release/issues/3100
    • @idailylife 一旦有了新版本,你就无法连接到远程,因为 vscode 将使用新的提交 id 来连接不存在的服务器
    • 您可以将commit:<commit> 替换为latest 以获取最新版本。示例:https://update.code.visualstudio.com/latest/server-linux-x64/stable。尊重表示质量,即stableinsider
    • 仅供参考,commit_id 与此处发布的提交哈希匹配:github.com/microsoft/vscode/releases
    猜你喜欢
    • 2021-08-03
    • 1970-01-01
    • 2018-07-09
    • 1970-01-01
    • 1970-01-01
    • 2018-11-13
    • 2015-09-26
    • 2016-10-19
    • 2020-09-10
    相关资源
    最近更新 更多