git clone: GnuTLS recv error (-9): A TLS packet with unexpected length was received

15,957

Solution 1

If you are in china,may be you should set proxy for git,for example

git config --global https.proxy 'socks5://127.0.0.1:9999'

Solution 2

This is Known bug as @Ivan Ternovtsiy said ,but there is workaround

Remove current GIT from your system

 sudo apt-get purge git

Download GIT deb git_1.9.1-1_amd64.deb link

Execute the downloaded DEB.

Solution 3

Your mileage may vary, but in my case I was suspecting two factors:

  • low download speed -> connection too long on big repository
  • my Internet provider doesn't like long connections and closes them

So I decided to change Internet provider and pick a higher bandwidth. It's working fine now. I'm not sure if only changing provider or picking a higher bandwidth would have been enough, so you'd have to try out.

Note: I used to use a workaround I mentioned in another question which is about shallow cloning, and that made me think that shorter connections may work.

Share:
15,957

Related videos on Youtube

Amith Jayasekara
Author by

Amith Jayasekara

AWS Certified Solutions Architect ( professional level ) Cloud enthusiast, a software architect with 12+ years of industry experience in creating and maintaining high-performance, scalable software in a wide range of domains.

Updated on September 18, 2022

Comments