git报错 failed: The TLS connection was non-properly terminated

腾讯云主机不知道为什么不能git clone,报错:

fatal: unable to access 'https://github.com/asdf-vm/asdf-plugins.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
plugin ruby not found in repository

查了下需要使用libcurl4-openssl-dev替换gnutls对git进行编译。

sudo apt-get install build-essential fakeroot dpkg-dev
mkdir ~/git-openssl
cd ~/git-openssl
sudo apt-get source git
sudo apt-get build-dep git

如果出现找不到源代码的报错,使用命令sudo vim /etc/apt/sources.list打开文件并取消带deb_src那一行的注释,保存后运行sudo apt update,然后再执行上面最后一条命令
接着:

sudo apt-get install libcurl4-openssl-dev
sudo dpkg-source -x git_2.17.1-1ubuntu0.9.dsc
cd git_2.17.1 #实际版本可能不同

然后编辑文件debian/control,使用命令sudo vim deebian/control,将全部的libcurl4-gnutls-dev改为libcurl4-openssl-dev 。(我这里只遇见了一个libcurl4-gnutls-dev)
接着运行命令:

#这一步时间会很长,耐心等待
sudo dpkg-buildpackage -rfakeroot -b

sudo dpkg -i git_2.17.1-1ubuntu0.9_amd64.deb

 到这里就结束了,再次git就可以了

+ git clone https://github.com/asdf-vm/asdf.git /root/.asdf --depth 1
Cloning into '/root/.asdf'...
+ echo -e '\n. $HOME/.asdf/asdf.sh'
+ echo -e '\n. $HOME/.asdf/completions/asdf.bash'
+ echo -e 'legacy_version_file = yes'
+ asdf plugin-add ruby
initializing plugin repository...Cloning into '/root/.asdf/repository'...

------------------------------------------------------------------------------------更新

下午又重新搞了一次还是有相同的问题,最后重置代理 完美解决

git config --global --unset https.https://github.com.proxy 
git config --global --unset http.https://github.com.proxy 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值