Centos

無法續訂讓我們使用 certbot 進行加密

  • January 13, 2020

我正在執行 centos 6,我最近嘗試安裝 python 3,可能搞砸了與 python 相關的東西

如果我做

python2 /usr/local/bin/certbot-auto renew

我明白了

file "/usr/local/bin/certbot-auto", line 20 if [ -z "$HOME" ]; then ^ 
SyntaxError: invalid syntax

如果我做

/usr/local/bin/certbot-auto renew

我明白了

import ssl File "/usr/local/lib/python2.7/ssl.py", line 146, in <module> 
import base64        # for DER-to-PEM translation File 
"/usr/local/lib/python2.7/base64.py", line 11, in <module> import binascii 
ImportError: No module named binascii WARNING: unable to check for 
updates. Traceback (most recent call last): File "<stdin>", line 16, in 
<module> File "/usr/local/lib/python2.7/distutils/version.py", line 140, 
in cmp compare = cmp(self.version, other.version) AttributeError: 
StrictVersion instance has no attribute 'version' root@~$

Certbot 試圖使用損壞的 python 2.6 執行,我閱讀了 certbot bash 腳本,發現它也可以使用 python 3 執行,所以我像這樣使用 python 3 執行它

USE_PYTHON_3=1 ./usr/local/bin/certbot-auto renew

問題已解決

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