python 更新后 add-apt-repository 出现故障

python 更新后 add-apt-repository 出现故障

更新后,Add-apt-repository 不再起作用。我现在看到一个 python3.8 文件夹,并且我更新了 3 个 python 模块。到目前为止,我已经花了几天时间尝试使用符号链接的各种建议修复,并重新安装了大部分 python。什么都没用。大多数建议的修复都是几年前的,与现在安装的 python 版本无关。

更新的模块以及可能的根本原因是:

python3-distutils:amd64(3.6.8-1~18.04、3.6.9-1~18.04)python3-lib2to3:amd64(3.6.8-1~18.04、3.6.9-1~18.04)python3-gdbm:amd64(3.6.8-1~18.04、3.6.9-1~18.04)

我最近(几周前)使用过 add-apt-repository 添加新存储库,没有任何问题。之前也从未遇到过任何问题。

我有 python2.7、python3、python3.6、python3.7,现在还有 python3.8,没有一个是手动安装的。全部来自自动更新。

python3 -V产生 Python 3.6.8

这是我使用 add-apt-repository 命令时遇到的错误:

keith@Serenity:/usr/lib/python3/dist-packages$ sudo add-apt-repository ppa:sicklylife/gnucash
^CTraceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 136, in <module>
    shortcut = shortcut_handler(line)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 868, in shortcut_handler
    ret = factory(shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 398, in shortcut_handler
    return PPAShortcutHandler(shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 355, in __init__
    info = get_ppa_info(self.shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 326, in get_ppa_info
    ret = get_ppa_info_from_lp(user, ppa)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 101, in get_ppa_info_from_lp
    return get_info_from_lp(lp_url)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 95, in get_info_from_lp
    return get_info_from_https(lp_url, True)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 88, in get_info_from_https
    data = _get_https_content_py3(url, accept_json)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 120, in _get_https_content_py3
    lp_page = urllib.request.urlopen(request, cafile=LAUNCHPAD_PPA_CERT)
  File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/lib/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 1361, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/lib/python3.6/urllib/request.py", line 1318, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/lib/python3.6/http/client.py", line 1254, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1300, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1249, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1036, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 974, in send
    self.connect()
  File "/usr/lib/python3.6/http/client.py", line 1407, in connect
    super().connect()
  File "/usr/lib/python3.6/http/client.py", line 946, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
KeyboardInterrupt
keith@Serenity:/usr/lib/python3/dist-packages$ 

相关内容