Certbot Broken, just tried to renew certificate

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: samuele.site

I ran this command: sudo certbot --apache

It produced this output:

Traceback (most recent call last):
  File "/usr/bin/certbot", line 33, in <module>
    sys.exit(load_entry_point('certbot==1.21.0', 'console_scripts', 'certbot')())
  File "/usr/bin/certbot", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 957, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 548, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for certbot

My web server is (include version): Ubuntu 20.04

The operating system my web server runs on is (include version): Apache2

My hosting provider, if applicable, is: Time4VPS

I can login to a root shell on my machine (yes or no, or I don't know):

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): can't run the command, same error above.

Hello everyone! I'll add this here, I have already tried the purge command and the pip uninstall (was not installed through pip). Reinstalling after purge didn't work

Try:
Certbot Instructions | Certbot (eff.org)

4 Likes

pip can uninstall any installed Python packages.

The errors you have, and the traceback lines above, suggest you did not follow the recommended instructions and installed or executed Certbot in a virtual environment, instead relying on a global system wide installation. That pattern is not recommended or supported. Was this possibly installed from a third-party Debian package repository?

You should completely remove Certbot's ubuntu packages and the python packages, then follow the Certbot instructions to either:

  1. Install via snapd (recommended)
  2. Install via pip into a virtual environment
3 Likes

THANKS! This here worked, especially this command: sudo apt-get remove certbot

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.