Dave
Dave

Reputation: 389

Letsencrypt certificate upgrade issue

On Ubuntu 16.04.2 LTS, I am trying to upgrade letsencrypt certificate by using ./letsencrypt-auto renew --dry-run and its giving below error

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

Can you please help here

Upvotes: 1

Views: 999

Answers (3)

tapin13
tapin13

Reputation: 51

This works for me (Linux Debian 3.16.64-2):

mv /opt/eff.org/certbot /opt/eff.org/certbot.old

certbot-auto

Upvotes: 0

Mouse Reeve
Mouse Reeve

Reputation: 267

I solved this problem by deleting the virtualenv bin directory and re-running the certbot-auto command, which will cause certbot to re-install dependencies. To find the location of the directory, look at the first line of the error response: Error: couldn't get currently installed version for /root/.local/share/letsencrypt/bin/letsencrypt. This location will vary.

Accordingly, deleting /root/.local/share/letsencrypt/bin/ should remove the installed dependencies and got the certs but up and running.

Upvotes: 0

freemanpolys
freemanpolys

Reputation: 1998

Just do

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

and try again.

Upvotes: 1

Related Questions