使用VS code 远程连接ssh主机报错:XHR faild(wget download failed)

使用VS code 远程连接ssh主机报错:

XHR faild(wget download failed)

[09:26:55.079] > wget download failed > wget: unable to resolve host address ‘update.code.visualstudio.com

即下载vscode-server-linux-x64.tar.gz报错

1.远程主机查看: vscode-server.tar.gz 文件为空

-rw-rw-r-- 1 root root 0 Jan 20 13:48 vscode-server.tar.gz

[XXX@ca70ba6b3061 3b889b090b5ad5793f524b5d1d39fda662b96a2a]$ pwd

/home/XXX/.vscode-server/bin/3b889b090b5ad5793f524b5d1d39fda662b96a2a

2.替换如下地址:

https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable

中commit_id为1中 3b889b090b5ad5793f524b5d1d39fda662b96a2a

即https://update.code.visualstudio.com/3b889b090b5ad5793f524b5d1d39fda662b96a2a/server-linux-x64/stable

3.可科学上网环境下载如下:

wget -O vscode-server-linux-x64.tar.gz https://update.code.visualstudio.com/commit:3b889b090b5ad5793f524b5d1d39fda662b96a2a/server-linux-x64/stable

4.将下载下的文件 上传到远程服务器的如下目录:/home/XXX/.vscode-server/bin/

scp -P {port} vscode-server-linux-x64.tar.gz XXX@ip:/home/XXX/

5.解压vscode-server-linux-x64.tar.gz 到 commit_id 目录下(注意不要目录vscode-server-linux-x64 )

tar zxvf /home/XXX/.vscode-server/bin/3b889b090b5ad5793f524b5d1d39fda662b96a2a/vscode-server-linux-x64.tar.gz -C /home/XXX/.vscode-server/bin/3b889b090b5ad5793f524b5d1d39fda662b96a2a/ --strip 1

6.touch /home/XXX/.vscode-server/bin/3b889b090b5ad5793f524b5d1d39fda662b96a2a/0

再次本机连接远程服务器成功。

你可能感兴趣的:(linux,ssh,服务器,linux,vscode)