背景:在vscode中使用remote-ssh插件时,需要在远程服务器安装vscode-server。在无法正常访问网络时,可按以下步骤进行离线安装。
https://stackoverflow.com/questions/56671520/how-can-i-install-vscode-server-in-linux-offline
- First get commit id
- Download vscode server from url:
https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable
- Upload the
vscode-server-linux-x64.tar.gz
to server - Unzip the downloaded
vscode-server-linux-x64.tar.gz
to~/.vscode-server/bin/${commit_id}
without vscode-server-linux-x64 dir - Create
0
file under~/.vscode-server/bin/${commit_id}
其中commit_id
与使用的vscode版本对应,可通过查看tags进行确定。
如vscode-stable-1.47.3对应的commit_id
为91899dcef7b8110878ea59626991a18c8a6a1b3e
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
VS Code安装包下载加速源
安装包下载慢,可使用源vscode.cdn.azure.cn,ref
例如:VSCodeUserSetup-x64-1.58.0.exe
原始下载链接:
使用加速源: