尝试更新证书时出现“错误:无法获取当前安装的 letsencrypt 版本”

尝试更新证书时出现“错误:无法获取当前安装的 letsencrypt 版本”

当我尝试在 Ubuntu 15.04 + nginx 服务器上更新我的 letsencrypt 证书时开始出现错误。

即使我尝试运行该certbot-auto命令,我也会看到以下内容:

Error: couldn't get currently installed version for /root/.local/share/letsencrypt/bin/letsencrypt:
An unexpected error occurred:
VersionConflict: (certbot 0.11.1 (/root/.local/share/letsencrypt/lib/python2.7/site-packages), Requirement.parse('certbot==0.10.2'))
Please see the logfile 'certbot.log' for more details.

certbot.log文件提供以下堆栈跟踪:

Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/bin/letsencrypt", line 11, in <module>
    sys.exit(main())
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/main.py", line 858, in main
    plugins = plugins_disco.PluginsRegistry.find_all()
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/plugins/disco.py", line 183, in find_all
    plugin_ep = PluginEntryPoint(entry_point)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/plugins/disco.py", line 34, in __init__
    self.plugin_cls = entry_point.load()
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2295, in load
    self.require(*args, **kwargs)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2318, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 859, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
VersionConflict: (certbot 0.11.1 (/root/.local/share/letsencrypt/lib/python2.7/site-packages), Requirement.parse('certbot==0.10.2'))

我也尝试运行sudo apt-get install certbotsudo apt-get install certbot-auto,但出现另一个错误:E: Unable to locate package certbot

这可能是什么问题?我该怎么办?

答案1

引发的异常实际上告诉您出了什么问题,您调用的 certbot 版本与预期版本相比太新了。

从外观上看,这是 certbot 的一次失败的更新,存在内部冲突,我建议从 GitHub 中提取最新版本并重新启动certbot-auto

如果这不起作用,请清除 certbot 的虚拟环境并重新安装。

相关内容