国内镜像快速下载vscode server

1. 找到vs code的提交版本号:

打开远端项目时会显示setting up: downloading vs code server 之类的提示,这时在远端执行

ps aux | grep wget 

可以看到

 wget --tries=0 --connect-timeout=7 --dns-timeout=7 --show-progress -nv -O vscode-server.tar.gz   http://update.code.visualstudio.com/commit:b3318bc0524af3d74034b8bb8a64df0ccf35549a/server-linux-x64/stable

2. 找到真正的下载地址, 将上面的wget 移除-nv

wget --tries=0 --connect-timeout=7 --dns-timeout=7 --show-progress -O vscode-server.tar.gz   http://update.code.visualstudio.com/commit:b3318bc0524af3d74034b8bb8a64df0ccf35549a/server-linux-x64/stable
URL transformed to HTTPS due to an HSTS policy
--2021-11-08 15:57:26--  https://update.code.visualstudio.com/commit:b3318bc0524af3d74034b8bb8a64df0ccf35549a/server-linux-x64/stable
Resolving update.code.visualstudio.com (update.code.visualstudio.com)... 20.43.132.130
Connecting to update.code.visualstudio.com (update.code.visualstudio.com)|20.43.132.130|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://az764295.vo.msecnd.net/stable/b3318bc0524af3d74034b8bb8a64df0ccf35549a/vscode-server-linux-x64.tar.gz [following]
--2021-11-08 15:57:26--  https://az764295.vo.msecnd.net/stable/b3318bc0524af3d74034b8bb8a64df0ccf35549a/vscode-server-linux-x64.tar.gz
Resolving az764295.vo.msecnd.net (az764295.vo.msecnd.net)... 117.18.232.200
Connecting to az764295.vo.msecnd.net (az764295.vo.msecnd.net)|117.18.232.200|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 53650674 (51M) [application/gzip]
Saving to: ‘vscode-server.tar.gz’

3. 使用vscode.cdn.azure.cn取代az764295.vo.msecnd.net

wget --tries=0 --connect-timeout=7 --dns-timeout=7 --show-progress -O vscode-server.tar.gz   https://vscode.cdn.azure.cn/stable/b3318bc0524af3d74034b8bb8a64df0ccf35549a/vscode-server-linux-x64.tar.gz

替换后的下载速度大概为1.72MB/s, 比原来的2kb/s快了几百倍。

4. 将下载的文件放入~/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a

5. 解压

tar xf vscode-server.tar.gz

6. 移动一级目录到上层

mv vscode-server-linux-x64/* .

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值