完美解决ubuntu中git clone安卓内核时报error: RPC failed; curl 56 GnuTLS recv error (-9):错误的处理

问题一

在ubuntu中使用git命令从清华的开源软件镜像站中克隆安卓内核,但是报如下错误:

$ git clone https://aosp.tuna.tsinghua.edu.cn/kernel/goldfish
Cloning into 'goldfish'...
remote: Enumerating objects: 116, done.
remote: Counting objects: 100% (116/116), done.
remote: Compressing objects: 100% (69/69), done.
error: RPC failed; curl 56 GnuTLS recv error (-9): Error decoding the received TLS packet.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

解决

查询了一些博客,这个错误总结出应该是文件过大的原因

根据参考1中的第一个问题的方法,分别执行如下命令,问题解决:

设置git最低速度
$ git config --global http.lowSpeedLimit 0
$ git config --global http.lowSpeedTime 999999
设置http缓存
$ git config --global http.postBuffer 1048576000

其中,postBuffer是用于设置Http缓存,可以设置的大一些,比如1G:git config --global http.postBuffer 1048576000,或者3G 3194304000

问题二

GnuTLS recv error (-9): Error decoding the received TLS packet

解决

# sudo apt install gnutls-bin
# git config --global http.sslVerify false
# git config --global http.postBuffer 1048576000 //增加至1GB缓存
 
//设置git最小和最大下载速度
# git config --global http.lowSpeedLimit 0
# git config --global http.lowSpeedTime 999999
 
//以下步骤大大加快git下载速度
# git config --global core.compression -1    
# export GIT_TRACE_PACKET=1
# export GIT_TRACE=1
# export GIT_CURL_VERBOSE=1
 
# sudo ifconfig eth0 mtu 14000

问题三

今天拉取代码,出现如下所示错误:

    error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.
    fatal: The remote end hung up unexpectedly
    fatal: early EOF
    fatal: index-pack failed
    Failed during: git fetch origin --force

迟迟拉不下来.

解决

    # 如果是针对当前项目(5G Buffer Storage)
    $ git config --local http.postBuffer 5000000000
     
    # 如何是针对全局项目(5G Buffer Storage)
    $ git config --global http.postBuffer 5000000000
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐