Python

SSL 支持不可用,Ubuntu 18.04,ppa 儲存庫

  • July 17, 2019

我正在嘗試更新我的 certbot ppa 儲存庫,但是:

root@reaver.home.lan:~# add-apt-repository ppa:certbot/certbot
Traceback (most recent call last):
 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 210, in urlopen
   raise ValueError('SSL support not available')
ValueError: SSL support not available

During handling of the above exception, another exception occurred:

Traceback (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 338, in get_ppa_info
   _get_suggested_ppa_message(user, ppa))
 File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 295, in _get_suggested_ppa_message
   lp_user = get_info_from_lp(LAUNCHPAD_USER_API % user)
 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 210, in urlopen
   raise ValueError('SSL support not available')
ValueError: SSL support not available
root@reaver.home.lan:~#

Distro 是 Ubuntu 18.04.2 LTS,我很確定我已經安裝了 OpenSSL。

root@reaver.home.lan:~# dpkg -l |grep openssl
ii  libgnutls-openssl27:amd64             3.5.18-1ubuntu1.1                          amd64        GNU TLS library - OpenSSL wrapper
ii  openssl                               1.1.1-1ubuntu2.1~18.04.4                   amd64        Secure Sockets Layer toolkit - cryptographic utility
ii  perl-openssl-defaults:amd64           3build1                                    amd64        version compatibility baseline for Perl OpenSSL packages
ii  python3-openssl                       17.5.0-1ubuntu1                            all          Python 3 wrapper around the OpenSSL library
root@reaver.home.lan:~#

請告訴我是否需要更多資訊。提前致謝。

有人在系統上安裝了 OpenSSL 的自定義副本,這會干擾系統 OpenSSL。

要解決此問題,請刪除安裝在/usr/local/bin和中的 OpenSSL 二進製文件和庫文件/usr/local/lib

引用自:https://serverfault.com/questions/975527