如何在 linux 中离线安装 vscode-server [英] How can I install vscode-server in linux offline

查看:117
本文介绍了如何在 linux 中离线安装 vscode-server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装 VScode 远程 ssh 扩展,但我的远程主机无法连接到 Internet,因此无法下载软件.所以我收到了一些这样的错误信息:

I am trying to install VScode remote-ssh extensions, but my remote host could not connect to the Internet,so there is no way to download software is needed. So I got some error message like that:

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.

我该如何解决这个问题?

How could I fix this problem ?

推荐答案

  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}
  6. 下创建0文件
  1. First get commit id
  2. Download vscode server from url: https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable
  3. Upload the vscode-server-linux-x64.tar.gz to server
  4. Unzip the downloaded vscode-server-linux-x64.tar.gz to ~/.vscode-server/bin/${commit_id} without vscode-server-linux-x64 dir
  5. Create 0 file under ~/.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

- 或 -

请参阅此要点 download-vs-code-server 以获取更完整的 shell 脚本还可以获取最新发布的提交 SHA(来自 GitHub),因此您无需自己提供.

See this Gist download-vs-code-server for a more complete shell script that will also get the latest released commit SHA (from GitHub) so you do not need to supply it yourself.

您可以将 commit: 替换为 latest 以获得最新的发布版本.示例:https://update.code.visualstudio.com/latest/server-linux-x64/stable.尊重指示的质量,即stableinsider.– Doom5

You can replace commit:<commit> with latest to get the latest release build. Example: https://update.code.visualstudio.com/latest/server-linux-x64/stable. Respects indicated quality i.e, stable, insider. – Doom5

这篇关于如何在 linux 中离线安装 vscode-server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆