Ubuntu – add-apt-repository returns unexpected length error

add-apt-repository

Ubuntu 11.10 (oneiric ocelot):
When I try to add a new ppa through add-apt-repository, it returns with:

rene@rene-MS-N104:~$ sudo add-apt-repository ppa:tualatrix/ppa
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 88, in <module>
    ppa info = get_ppa_info_from_lp(usr, ppa_name)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 80, in get_ppa_info_from_lp
    curl.perform()
pycurl.error(35, 'gnutls_handshake() failed: A TLS packet with unexpected length was recieved.')

I'm fairly new to Ubuntu and am not sure how to proceed.

Best Answer

It appears this is a known issue/bug, you could try this workaround:

To install PPA's, add them to /etc/apt/sources.list in the form:

Before:

ppa:<user>/<repo>

Add to sources.list:

deb http://ppa.launchpad.net/<user>/<repo>/ubuntu oneiric main

Then sudo apt-get update and download whatever packages you want.