添加 mozillateam/ppa 存储库超时

添加 mozillateam/ppa 存储库超时

我正在使用 Kubuntu 22.04,apt update 和 upgrade 工作正常。

我正在跟进https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04卸载 Firefox snap 并从 apt 安装,但是当我添加 mozillateam/ppa 时它会挂起几分钟,然后出现超时错误:

$ sudo add-apt-repository ppa:mozillateam/ppa
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 472, in __init__
    self._wadl = self._browser.get_wadl_application(self._root_uri)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 447, in get_wadl_application
    response, content = self._request(url, media_type=wadl_type)
  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 1363, in _conn_request
    conn.connect()
  File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1153, in connect
    sock.connect((self.host, self.port))
TimeoutError: [Errno 110] Connection timed out

这是我这边出了什么问题需要我去解决吗?

答案1

其他用户报告说,如果安装该软件包,问题就已解决python-is-python3

首先,更新系统:

sudo apt update
sudo apt upgrade

接下来安装:

sudo apt install python-is-python3

这将为 python3 创建一个符号链接,以便当您或系统执行时python,它将链接到python3

我相信在完全切换到之后,默认情况下此功能被禁用,以便python3向后兼容需要默认python2链接的系统python。但对于大多数人来说,我们需要它链接到python3,因为python2不久前就被弃用了。

然后,按照 PPA 安装说明继续。


如果这不起作用,则可能是网络问题。ppa 位于http://ppa.launchpad.net/mozillateam/ppa/ubuntu

如果 pinglaunchpad.net没有返回任何结果,你也许可以禁用 IPV6 来解决问题

答案2

我添加了一个生成堆栈跟踪的快速登录 Python 文件,它尝试连接到 api.launchpad.net。它解析为 2620:2d:4000:1001::8003,超时了。我发现它也能解析为 185.125.189.224,这样就行了。

我将它添加到 /etc/hosts 并且现在它可以工作了!

相关内容