![尝试更新证书时出现“错误:无法获取当前安装的 letsencrypt 版本”](https://linux22.com/image/698155/%E5%B0%9D%E8%AF%95%E6%9B%B4%E6%96%B0%E8%AF%81%E4%B9%A6%E6%97%B6%E5%87%BA%E7%8E%B0%E2%80%9C%E9%94%99%E8%AF%AF%EF%BC%9A%E6%97%A0%E6%B3%95%E8%8E%B7%E5%8F%96%E5%BD%93%E5%89%8D%E5%AE%89%E8%A3%85%E7%9A%84%20letsencrypt%20%E7%89%88%E6%9C%AC%E2%80%9D.png)
当我尝试在 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 certbot
和sudo apt-get install certbot-auto
,但出现另一个错误:E: Unable to locate package certbot
。
这可能是什么问题?我该怎么办?
答案1
引发的异常实际上告诉您出了什么问题,您调用的 certbot 版本与预期版本相比太新了。
从外观上看,这是 certbot 的一次失败的更新,存在内部冲突,我建议从 GitHub 中提取最新版本并重新启动certbot-auto
。
如果这不起作用,请清除 certbot 的虚拟环境并重新安装。