2017-03-13 289 views
1

在Ubuntu 16.04.2 LTS,我想letsencrypt證書升級使用 ./letsencrypt-auto更新--dry運行及其給下面的錯誤Letsencrypt證書升級問題

Error: couldn't get currently installed version for /root/.local/share/letsencrypt/bin/letsencrypt: 
Traceback (most recent call last): 
    File "/root/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module> 
    from certbot.main import main 
    File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/main.py", line 13, in <module> 
    from acme import jose 
    File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/__init__.py", line 37, in <module> 
    from acme.jose.interfaces import JSONDeSerializable 
    File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/interfaces.py", line 9, in <module> 
    from acme.jose import util 
    File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/jose/util.py", line 4, in <module> 
    from cryptography.hazmat.primitives.asymmetric import rsa 
    File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py", line 14, in <module> 
    from cryptography.hazmat.backends.interfaces import RSABackend 
    File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/cryptography/hazmat/backends/__init__.py", line 7, in <module> 
    import pkg_resources 
    File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 36, in <module> 
    import plistlib 
    File "/usr/lib/python2.7/plistlib.py", line 62, in <module> 
    import datetime 
ImportError: No module named datetime 

能否請您在這裏幫助

回答

-1

只是做

rm -rf /root/.local/share/letsencrypt/bin/letsencrypt 

,然後再試一次。

+1

不良風格。永遠不要發佈shell命令。如何在不解釋後果的情況下向「rm -rf」提供建議?對我來說,它甚至沒有做到這一點,只是觸發「virtualenv:找不到」。 我建議你閉嘴一年,潛伏mo。。 –

+0

@MelchiorBlausand雖然我有點贊同你的評論,但你不應該打電話給別人的名字,也不要忽略[很好](https://stackoverflow.com/help/be-nice)政策。 – GrumpyCrouton

0

我通過刪除virtualenv bin目錄並重新運行certbot-auto命令來解決此問題,這將導致certbot重新安裝依賴項。要查找目錄的位置,請查看錯誤響應的第一行: Error: couldn't get currently installed version for /root/.local/share/letsencrypt/bin/letsencrypt。這個位置會有所不同。

因此,刪除/root/.local/share/letsencrypt/bin/應刪除已安裝的依賴關係並獲得證書,但已啓動並正在運行。