完美解决ubuntu中git clone安卓内核时报error: RPC failed; curl 56 GnuTLS recv error (-9):错误的处理
- 问题一
- 解决
- 问题二
- 解决
- 问题三
- 解决
问题一
在ubuntu中使用git命令从清华的开源软件镜像站中克隆安卓内核,但是报如下错误:
$ git clone https://aosp.tuna.tsinghua.edu.cn/kernel/goldfishCloning 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 unexpectedlyfatal: early EOFfatal: 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