11

I tried to clone my project on my linux server via git and suddenly got this error:

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

This is asked many times, but answered none.

I am using bitbucket.

Silidrone
  • 1,471
  • 4
  • 20
  • 35
  • as masadi zainul noticed, potential duplicate of [git clone: GnuTLS recv error (-9): A TLS packet with unexpected length was received](https://stackoverflow.com/questions/31044234/git-clone-gnutls-recv-error-9-a-tls-packet-with-unexpected-length-was-recei) (proposed duplicate flag to get the proper metadata in place) – hsandt Dec 20 '19 at 13:13

1 Answers1

11

It turns out you just need to remove git with sudo apt-get purge git but NOT with sudo apt-get --purge git for some reason it wont work if you do --purge. Now install it again by typing sudo apt-get install git. And then when you try your clone, it should work properly.

Silidrone
  • 1,471
  • 4
  • 20
  • 35
  • same with http://stackoverflow.com/questions/31044234/git-clone-gnutls-recv-error-9-a-tls-packet-with-unexpected-length-was-recei – masadi zainul Dec 01 '16 at 03:26
  • Seems like `remove` is needed when you use `--purge`: (from man apt-get: remove --purge is equivalent to the purge command) So it should be `apt-get remove --purge package` – Miguel Ortiz Jan 24 '19 at 19:49