Score:3

error with add-apt-repository

jp flag

I tried to add a ppa and y got the message here after. The ppa is not added, i.e. not in /etc/apt/sources.list.d.

$ sudo add-apt-repository -d ppa:fenics-packages/fenics
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1363, in _conn_request
    conn.connect()
  File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1139, in connect
    address_info = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM)
  File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 364, in <module>
    sys.exit(0 if addaptrepo.main() else 1)
  File "/usr/bin/add-apt-repository", line 347, in main
    shortcut = handler(source, **shortcut_params)
  File "/usr/lib/python3/dist-packages/softwareproperties/shortcuts.py", line 40, in shortcut_handler
    return handler(shortcut, **kwargs)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 82, in __init__
    if self.lpppa.publish_debug_symbols:
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 120, in lpppa
    self._lpppa = self.lpteam.getPPAByName(name=self.ppaname)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 107, in lpteam
    self._lpteam = self.lp.people(self.teamname)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 98, in lp
    self._lp = login_func("%s.%s" % (self.__module__, self.__class__.__name__),
  File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 494, in login_anonymously
    return cls(
  File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 230, in __init__
    super(Launchpad, self).__init__(
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 477, in __init__
    self._browser.get(root_resource), 'application/json')
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 439, in get
    response, content = self._request(url, extra_headers=headers)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 389, in _request
    response, content = self._request_and_retry(
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 359, in _request_and_retry
    response, content = self._connection.request(
  File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1725, in request
    (response, content) = self._request(
  File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 144, in _request
    response, content = super(LaunchpadOAuthAwareHttp, self)._request(
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 184, in _request
    return super(RestfulHttp, self)._request(
  File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1441, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1370, in _conn_request
    raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
httplib2.error.ServerNotFoundError: Unable to find the server at api.launchpad.test

Notice it is not due the ppa since I have tried several other ppa. Moreover, I also tried to purge software-properties-common, and it has not fixed the problem.

Here are the info of my system :

$ lsb_release -rd
Description: Ubuntu 22.04.2 LTS
Release: 22.04

Here is the version of the package:

$ apt-cache policy software-properties-common
software-properties-common:
  Installé : 0.99.22.7
  Candidat : 0.99.22.7
 Table de version :
 *** 0.99.22.7 500
        500 http://fr.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        500 http://fr.archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages
        100 /var/lib/dpkg/status
     0.99.22 500
        500 http://fr.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        500 http://fr.archive.ubuntu.com/ubuntu jammy/main i386 Packages

Here are version of other packages on which software-properties-common depends on:

$ apt-cache policy python3-software-properties
python3-software-properties:
  Installé : 0.99.22.7
  Candidat : 0.99.22.7
 Table de version :
 *** 0.99.22.7 500
        500 http://fr.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        500 http://fr.archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages
        100 /var/lib/dpkg/status
     0.99.22 500
        500 http://fr.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        500 http://fr.archive.ubuntu.com/ubuntu jammy/main i386 Packages

$ apt-cache policy python-apt-common
python-apt-common:
  Installé : 2.4.0ubuntu1
  Candidat : 2.4.0ubuntu1
 Table de version :
 *** 2.4.0ubuntu1 500
        500 http://fr.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        500 http://fr.archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages
        100 /var/lib/dpkg/status
     2.3.0ubuntu2 500
        500 http://fr.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        500 http://fr.archive.ubuntu.com/ubuntu jammy/main i386 Packages
guiverc avatar
cn flag
Have you made any changes to your *default* python3? eg. Errors like what you're seeing (*along with other tools that require a working python3*) are expected if you've changed defaults; is `python3 -V` showing the correct result for a 22.04.2 system?
letinain 26 avatar
jp flag
No changes to my knowledge. `$ python3 -VV Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0]`
Score:1
in flag

There was a bug raised which has since been resolved. Please see their official message

We've reverted the relevant part of frontend configuration and this is now fixed. However, if you're still seeing programs failing with errors that mention api.launchpad.test, then you'll need to run rm -rf ~/.launchpadlib/api.launchpad.net/cache/ and try again. (Unfortunately recovering automatically from bad cache data lifetime is hard!)

guiverc avatar
cn flag
This answer would have been better if you'd copy/pasted the text from those *Launchpad Status* account posts.... (*I can't see Colin Watson or whomever else can post to the ML would mind; esp. if you credit the source*) . This site prefers not answers to that require you to read another page that provides notice of the fix & workaround if it didn't fix the issue for you.
letinain 26 avatar
jp flag
This has done the trick ! I will just add that the folder to remove is in /root, so the command is `rm -rf /root/.launchpadlib/api.launchpad.net/cache/`
Score:0
mc flag

Try going with:

sudo apt-get install python3-launchpadlib

Solved the issue for me.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.