ubuntu - FileNotFoundError : add-apt-repository ppa:certbot/certbot

标签 ubuntu lets-encrypt certbot

我正在尝试在我的 Ubuntu 16.04 上安装 certbot 以获取 letencrypt 证书。
添加存储库出错。有人可以帮忙吗?提前致谢!

wordpress@MV-WP02:~$ sudo add-apt-repository ppa:certbot/certbot

回溯(最近一次通话最后):
文件“/usr/lib/python3/dist-packages/softwareproperties/ppa.py”,第 335 行,在 get_ppa_info
ret = get_ppa_info_from_lp(用户,ppa)
文件“/usr/lib/python3/dist-packages/softwareproperties/ppa.py”,第 92 行,在 get_ppa_info_from_lp
返回 get_info_from_lp(lp_url)
文件“/usr/lib/python3/dist-packages/softwareproperties/ppa.py”,第 88 行,在 get_info_from_lp
返回 _get_https_content_py3(lp_url)
_get_https_content_py3 中的文件“/usr/lib/python3/dist-packages/softwareproperties/ppa.py”,第 110 行
lp_page = urllib.request.urlopen(请求,cafile=LAUNCHPAD_PPA_CERT)
文件“/usr/lib/python3.5/urllib/request.py”,第 153 行,在 urlopen
卡帕特=卡帕特)
文件“/usr/lib/python3.5/ssl.py”,第 470 行,在 create_default_context
context.load_verify_locations(cafile, capath, cadata)
FileNotFoundError: [Errno 2] 没有这样的文件或目录

在处理上述异常的过程中,又出现了一个异常:

回溯(最近一次通话最后):
文件“/usr/bin/add-apt-repository”,第 122 行,在
快捷方式=快捷方式处理程序(行)
文件“/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py”,第 841 行,位于shortcut_handler
ret = 工厂(快捷方式)
文件“/usr/lib/python3/dist-packages/softwareproperties/ppa.py”,第 407 行,在快捷方式处理程序中
返回 PPAShortcutHandler(快捷方式)
文件“/usr/lib/python3/dist-packages/softwareproperties/ppa.py”,第 364 行,在 __init__
info = get_ppa_info(self.shortcut)
文件“/usr/lib/python3/dist-packages/softwareproperties/ppa.py”,第 347 行,在 get_ppa_info
_get_suggested_ppa_message(用户,ppa))
_get_suggested_ppa_message 中的文件“/usr/lib/python3/dist-packages/softwareproperties/ppa.py”,第 304 行
lp_user = get_info_from_lp(LAUNCHPAD_USER_API % 用户)
文件“/usr/lib/python3/dist-packages/softwareproperties/ppa.py”,第 88 行,在 get_info_from_lp
返回 _get_https_content_py3(lp_url)
_get_https_content_py3 中的文件“/usr/lib/python3/dist-packages/softwareproperties/ppa.py”,第 110 行
lp_page = urllib.request.urlopen(请求,cafile=LAUNCHPAD_PPA_CERT)
文件“/usr/lib/python3.5/urllib/request.py”,第 153 行,在 urlopen
卡帕特=卡帕特)
文件“/usr/lib/python3.5/ssl.py”,第 470 行,在 create_default_context
context.load_verify_locations(cafile, capath, cadata)
FileNotFoundError: [Errno 2] 没有这样的文件或目录

最佳答案

我有同样的错误,谷歌搜索让我到 this page ,作者说做的地方

# apt-get install --reinstall ca-certificates


# update-ca-certificates

这为我解决了错误。
查看受影响的软件包,这可能是 SSL 加密的问题,因为这也修复了 apt 不想更新也在 https 地址上的 Docker 存储库的问题。

关于ubuntu - FileNotFoundError : add-apt-repository ppa:certbot/certbot,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43308552/

相关文章:

apache - 有名为 'apache2' 的进程正在运行

ubuntu - 使用 virtualbox : Connection refused 将 bosh CLI 连接到 VM 时出错

ssl - Letsencrypt 不适用于 Android

ssl - NGINX - 此处不允许使用 "server"指令

docker - 使用Letsencrypt的本地Nginx反向代理到Docker容器

apache - 让我们用 ECC (P-521) 加密 csr

php -/etc/php5/conf.d 文件夹中的 .ini 文件有什么用?

php - 将 SSL 证书添加到我的 VPS 后,Wordpress 无法访问页面

ssl - 自动更新 website.com 和 *.website.com 证书的方式

ubuntu - 建议删除 SSL 证书并在 ubuntu 16 上使用 Letsencrypt NGINX 生成一个