使用 Git 同步時出現gnutls_handshake() failed: Error in the pull function


錯誤提示

fatal: unable to access 'https://android.googlesource.com/platform/prebuilts/qemu-kernel/': gnutls_handshake() failed: Error in the pull function. fatal: unable to access

fatal: unable to access 'https://android.googlesource.com/platform/frameworks/opt/net/ethernet/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

原因分析

由系統的 git 默認使用的 libcurl4-gnutls-dev 造成

解決辦法

安裝編譯環境
sudo apt-get update
sudo apt-get install build-essential fakeroot dpkg-dev libcurl4-openssl-dev
sudo apt-get build-dep git
mkdir git-openssl && cd git-openssl
sudo apt-get source git
替換為 libcurl4-openssl-dev
dpkg-source -x git_2.11.0-4.dsc
gksu sed -i 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/g' debian/control
重構.deb

刪除 debian/rules 中的TEST=test行gksu sed -i 's/TEST=test//g' debian/control
重構sudo dpkg-buildpackage -rfakeroot -b
安裝sudo dpkg -i ../git_2.11.0-4_amd64.deb


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM