Я не могу добавить PPA в свой ubuntu 20.04. Сообщения об ошибках ниже

каждый раз, когда я пытаюсь добавить PPA, кажется, что терминал останавливается. После нескольких минут, когда ничего не происходит, я нажимаю ctrl-c, и появляется несколько сообщений об ошибках. Это я пытался добавить mozilla ppa.

$ sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa
^CTraceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 137, in <module>
    shortcut = shortcut_handler(line)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 884, in shortcut_handler
    ret = factory(shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 469, in shortcut_handler
    return PPAShortcutHandler(shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 426, in __init__
    info = get_ppa_info(self.shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 380, in get_ppa_info
    ret = get_ppa_info_from_lp(user, ppa)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 110, in get_ppa_info_from_lp
    return get_info_from_lp(lp_url)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 104, in get_info_from_lp
    return get_info_from_https(lp_url, True)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 96, in get_info_from_https
    data = func(lp_url=url, accept_json=accept_json, retry_delays=retry_delays)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 138, in _get_https_content_py3
    lp_page = urllib.request.urlopen(request,
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1369, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.8/urllib/request.py", line 1326, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.8/http/client.py", line 1240, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1286, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1235, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1006, in _send_output
    self.send(msg)
  File "/usr/lib/python3.8/http/client.py", line 946, in send
    self.connect()
  File "/usr/lib/python3.8/http/client.py", line 1402, in connect
    super().connect()
  File "/usr/lib/python3.8/http/client.py", line 917, in connect
    self.sock = self._create_connection(
  File "/usr/lib/python3.8/socket.py", line 796, in create_connection
    sock.connect(sa)
KeyboardInterrupt

Это я пытался добавить репозиторий восстановления загрузки:

sudo add-apt-repository ppa:yannubuntu/boot-repair
^CTraceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 137, in <module>
    shortcut = shortcut_handler(line)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 884, in shortcut_handler
    ret = factory(shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 469, in shortcut_handler
    return PPAShortcutHandler(shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 426, in __init__
    info = get_ppa_info(self.shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 380, in get_ppa_info
    ret = get_ppa_info_from_lp(user, ppa)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 110, in get_ppa_info_from_lp
    return get_info_from_lp(lp_url)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 104, in get_info_from_lp
    return get_info_from_https(lp_url, True)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 96, in get_info_from_https
    data = func(lp_url=url, accept_json=accept_json, retry_delays=retry_delays)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 138, in _get_https_content_py3
    lp_page = urllib.request.urlopen(request,
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1369, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.8/urllib/request.py", line 1326, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.8/http/client.py", line 1240, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1286, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1235, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1006, in _send_output
    self.send(msg)
  File "/usr/lib/python3.8/http/client.py", line 946, in send
    self.connect()
  File "/usr/lib/python3.8/http/client.py", line 1402, in connect
    super().connect()
  File "/usr/lib/python3.8/http/client.py", line 917, in connect
    self.sock = self._create_connection(
  File "/usr/lib/python3.8/socket.py", line 796, in create_connection
    sock.connect(sa)
KeyboardInterrupt

ОБНОВЛЕНИЕ:

После запуска с python3 -m trace --trace который add-apt -repository ppa: ubuntu-mozilla-daily / ppa как предлагается, вот результат:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.8/trace.py", line 755, in <module>
    main()
  File "/usr/lib/python3.8/trace.py", line 743, in main
    t.runctx(code, globs, globs)
  File "/usr/lib/python3.8/trace.py", line 449, in runctx
    exec(cmd, globals, locals)
  File "/usr/bin/add-apt-repository", line 21, in <module>
    sys.stdout = io.TextIOWrapper(
  File "/usr/bin/add-apt-repository", line 21, in <module>
    sys.stdout = io.TextIOWrapper(
  File "/usr/lib/python3.8/trace.py", line 590, in localtrace_trace
    print("%s(%d): %s" % (bname, lineno,
ValueError: underlying buffer has been detached
Exception ignored in: <_io.TextIOWrapper mode='w' encoding='utf-8'>
ValueError: underlying buffer has been detached

ОБНОВЛЕНИЕ: Я просто попытался вручную добавить ppa сюда: /etc/apt/sources.list и импортировав ключ GPG и это сработало. Так что я думаю, что что-то не так с моим apt?

Тай очень за помощь!

0
задан 18 August 2020 в 14:12

1 ответ

Когда вы нажимаете Ctrl-C, оно умирает. в sock.connect, это означает, что он пытается и ожидает подключения к удаленному хосту. Либо с этим хостом что-то не так, либо сеть, к которой вы подключены, препятствует доступу к этому хосту.

0
ответ дан 21 August 2020 в 07:57

Другие вопросы по тегам:

Похожие вопросы: