Certbot: command not found after reinstalling

I recently installed Certbot and everything worked fine. I wanted to exclude one folder and set up a .htaccess file. But somehow the configuration got messed up and nothing worked anymore. I tried to deinstall certbot with sudo certbot delete but it kept saying sudo: certbot: command not found. So I did sudo apt upgrade, sudo apt update and sudo apt dist-upgrade. They all said 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded..
I also tried to manually delete certbot with sudo apt purge certbot but it gives me an error with:

Failed to stop certbot.timer: Unit certbot.timer not loaded.
dpkg: error processing package certbot (–remove):
subprocess installed pre-removal script returned error exit status 5
/usr/bin/deb-systemd-helper: error: unable to read certbot.timer
Failed to get unit file state for certbot.timer: No such file or directory
certbot.timer is a disabled or a static unit, not starting it.
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried to deinstall python-certbot with sudo purge python-certbot but there’s the same error message.
And now if I try to do sudo apt upgrade, it says

You might want to run ‘apt --fix-broken install’ to correct these.
The following packages have unmet dependencies:
certbot : Depends: python3-certbot (= 0.28.0-1~deb9u2) but it is not installed
E: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).

So I did exactly that and now we are back where we started. I did sudo dpkg -l *certbot* and it showed me this:

(Screenshot because of formatting here)

I also tried reinstalling apache2 and deleteing the letsencrypt folder in etc/letsencrypt but that didn’t help either.


Any help is highly appreciated.

1 Like

What’s the output of:

whereis certbot

1 Like

Thank you for your quick reply!

When I type in whereis certbot it gives me this:


And nothing else

1 Like

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