You can use APT, PIP or SNAP to install on Focal / Ubuntu 20.04
(APT works - at least for now.)
But, do not use more than one install method, or mix them.
It sounds like you may have mixed install methods.
You may need to purge everything and start over?
Run these to clean up & delete Certbot first.
If you have certificate(s) already created you will need to recreate them.
Warning: The following lines will delete certbot and files completely!
sudo apt remove certbot* --purge # Purge any old certbots via apt.
sudo apt-add-repository --remove ppa:certbot/certbot # Remove certbot repo.
sudo snap remove certbot
sudo -H pip uninstall certbot; sudo -H pip3 uninstall certbot
pip uninstall certbot; pip3 uninstall certbot
sudo rm /usr/bin/certbot
sudo rm /usr/local/bin/certbot
rm ~/.local/usr/bin/certbot
rm ~/.local/bin/certbot
# You do not always need to delete the cert area, but it's usually best to start fresh:
sudo rm -rf /etc/letsencrypt
# Deactivate and remove any Certbot virtual Python environments you had running/setup.
# Example:
# `deactivate; sudo rm -rf /opt/certbot`
sudo apt update && sudo apt autoremove # Re-update and remove any orphaned packages.
Just ignore any errors (not founds).
That should cover all bases - both system-wide and user only.
Now decide how you want to install it.
PICK ONE AND ONLY ONE. Do not mix installation methods.
Snap
Installing snaps is easy enough, but I personally dislike using it. I prefer using python pip (as of right now). Snap would be my second choice.
Snap is well documented for Ubuntu Focal on the Certbot site already as the default installation method.
Pip
Instructions are here at Certbot site - or, a more comprehensive guide I wrote for pip installs is here.
Apt
sudo apt show certbot
Package: certbot
Version: 0.40.0-1ubuntu0.1
Priority: extra
Section: universe/web
Source: python-certbot
Origin: Ubuntu
( https://packages.ubuntu.com/focal/certbot )
The APT version has always been many versions behind.
This is no exception.
The current APT version is at v0.40.0 -> (Released Nov 5, 2019).
The current PIP and SNAP versions are v1.19.0 (as of Oct 1 2021).
I recommend using something a bit newer than what APT offers. Since Certbot deals with security/SSL and sometimes the LetsEncrypt/Certbot folks make changes you definitely may want to update to immediately. You may not be able to do that if you use the APT version. And as far as I know you cannot use the Certbot PPA for Ubuntu Focal/20, either.
So, stick with pip -or- snap as your installation method.
sudo add-apt-repository ppa:certbot/certbot
adds the certbot PPA to your list of trusted sources. Since you've added that to your sources, you may now install the packages they publish. After running that command, make sure to update bysudo apt-get update
, and now you'll be able to install the packages they publish (they list them here: launchpad.net/~certbot/+archive/ubuntu/certbot/+packages)