【Github】向github推送代码出现error: gnutls_handshake() failed GIT repository错误的解决方案

本文详细介绍了遇到Git clone GitHub仓库时出现TLS错误的解决方法,包括安装依赖包、编辑源代码文件等步骤,最终成功初始化并克隆空Git仓库。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

错误如下:

[html]  view plain  copy
 print ?
  1. $ git clone https://github.com/blah/blah.git  
  2. Initialized empty Git repository in /home/arun/.git/  
  3. error: gnutls_handshake() failed: A TLS packet with unexpected length was  
  4.        received. while accessing https://github.com/blah/blah.git/info/refs  
  5.   
  6. fatal: HTTP request failed  

解决方法:

[html]  view plain  copy
 print ?
  1. sudo apt-get install build-essential fakeroot dpkg-dev  
  2. mkdir ~/python-pycurl-openssl  
  3. cd ~/python-pycurl-openssl  
  4. sudo apt-get source python-pycurl  
  5. sudo apt-get build-dep python-pycurl  
  6. sudo apt-get install libcurl4-openssl-dev  
  7. sudo dpkg-source -x pycurl_7.19.0-4ubuntu3.dsc  
  8. cd pycurl-7.19.0  
  9. # remove the HAVE_CURL_GNUTLS=1 in the following file  
  10. sudo vim debian/patches/10_setup.py.dpatch  
  11. # remove the HAVE_CURL_GNUTLS=1 in the following file  
  12. sudo vim setup.py  
  13. # replace all gnutls into openssl in the following file  
  14. sudo vim debian/control  
  15. sudo dpkg-buildpackage -rfakeroot -b  
  16. sudo dpkg -i ../python-pycurl_7.19.0-4ubuntu3_amd64.deb  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值