代理github

前言

我在 clone github仓库的时候 会卡住 一致提示网络超时,以及 安装nvm 也会报错相关

root@someone:~# curl -o- raw.githubusercontent.com | bash

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 16631 100 16631 0 0 90910 0 --:--:-- --:--:-- --:--:-- 91379

=> Downloading nvm from git to '/root/.nvm'
=> Cloning into '/root/.nvm'...

fatal: unable to access 'github.com/nvm-sh/nvm.git': Failed to connect to github.com port 443 after 134755 ms: Couldn't connect to server
Failed to clone nvm repo. Please report this!

这一看就知道,这是国内访问不了github所至,我们修改host使其能访问即可!

修改host文件

最新的 github host在这里
怎么修改,修改什么它都有介绍!

其它方案

针对具体报错信息,我们可得知是shell脚本里 执行clone github.com/nvm-sh/nvm.git的时候挂了,
那我们还可以手动修改脚本,改为可以访问的仓库即可!

再或者开启服务器代理,这里就不方便多做介绍!

posted @ 2025-07-18 11:00  丁少华  阅读(92)  评论(0)    收藏  举报