I learned that my certbot version (0.40) is very old. So I set out to update it:
-
I made sure that I was running the latest edition of my Linux flavour
cat /etc/issue
Ubuntu 20.04.1 LTS \n \l
-
I made sure that my package lists were up-to-date:
apt update
[…snip…]
All packages are up to date.
-
I made sure my certbot copy is at the latest version:
apt upgrade certbot
[…snip…]
certbot is already the newest version (0.40.0-1).
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-
To refresh my memory how to properly install certbot on my flavor of Linux with my flavor of web server, I revisited this site:
https://certbot.eff.org/lets-encrypt/ubuntufocal-nginx -
It produced this outcome:
I learned that instead of a PPA they now instruct to use Snap -
I ran this command to get rid of the official Ubuntu certbot version (0.40.0):
apt remove certbot
-
As per instructions, I ran these commands to install Certbot:
sudo snap install --classic certbot
-
It produced this output:
Command 'snap' not found, but can be installed with:
apt install snapd
-
I concluded that my provider (Hetzner) has modified the default Ubuntu 20.04 instance because I read that Snap should be installed by default. I did not really want 120MB more SSD space to be wasted on my tiny VPS, so I tried to switch to PPA instead:
-
I ran this command:
sudo add-apt-repository ppa:certbot/certbot
-
It produced this output:
Err:10 http://ppa.launchpad.net/certbot/certbot/ubuntu focal Release
404 Not Found [IP: 2001:67c:1560:8008::15 80]
E: The repository 'http://ppa.launchpad.net/certbot/certbot/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
-
I googled what’s going on and learned that due to lack of experience with packaging by the certbot team, PPA has been abandoned in favor of the snap system.
-
So I ran this command to remove the PPA:
sudo add-apt-repository -r ppa:certbot/certbot
-
And installed snap by running this command:
apt install snapd
-
It produced this output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
squashfs-tools
Suggested packages:
zenity | kdialog
The following NEW packages will be installed:
snapd squashfs-tools
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 27.4 MB of archives.
After this operation, 120 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 squashfs-tools amd64 1:4.4-1 [121 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 snapd amd64 2.45.1+20.04.2 [27.3 MB]
Fetched 27.4 MB in 1s (34.2 MB/s)
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
Selecting previously unselected package squashfs-tools.
(Reading database ... 43539 files and directories currently installed.)
Preparing to unpack .../squashfs-tools_1%3a4.4-1_amd64.deb ...
Unpacking squashfs-tools (1:4.4-1) ...
Selecting previously unselected package snapd.
Preparing to unpack .../snapd_2.45.1+20.04.2_amd64.deb ...
Unpacking snapd (2.45.1+20.04.2) ...
Setting up squashfs-tools (1:4.4-1) ...
Setting up snapd (2.45.1+20.04.2) ...
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.apparmor.service → /lib/systemd/system/snapd.apparmor.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.autoimport.service → /lib/systemd/system/snapd.autoimport.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.core-fixup.service → /lib/systemd/system/snapd.core-fixup.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.recovery-chooser-trigger.service → /lib/systemd/system/snapd.recovery-chooser-trigger.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.seeded.service → /lib/systemd/system/snapd.seeded.service.
Created symlink /etc/systemd/system/cloud-final.service.wants/snapd.seeded.service → /lib/systemd/system/snapd.seeded.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.service → /lib/systemd/system/snapd.service.
Created symlink /etc/systemd/system/timers.target.wants/snapd.snap-repair.timer → /lib/systemd/system/snapd.snap-repair.timer.
Created symlink /etc/systemd/system/sockets.target.wants/snapd.socket → /lib/systemd/system/snapd.socket.
Created symlink /etc/systemd/system/final.target.wants/snapd.system-shutdown.service → /lib/systemd/system/snapd.system-shutdown.service.
snapd.failure.service is a disabled or a static unit, not starting it.
snapd.snap-repair.service is a disabled or a static unit, not starting it.
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
-
I installed Certbot as per instructions:
sudo snap install --classic certbot
-
It produced this output:
2020-08-29T23:39:11+03:00 INFO Waiting for automatic snapd restart...
certbot 1.7.0 from Certbot Project (certbot-eff✓) installed
-
I attempted to run certbot:
certbot
-
It produced this output:
Command 'certbot' is available in '/snap/bin/certbot'
The command could not be located because '/snap/bin' is not included in the PATH environment variable.
certbot: command not found
-
I attempted to find certbot with the find command:
find / -name certbot -type f -executable
/snap/certbot/500/bin/certbot
-
I attempted to run the found file:
/snap/certbot/500/bin/certbot
Traceback (most recent call last):
File "/snap/certbot/500/bin/certbot", line 5, in <module>
from certbot.main import main
ModuleNotFoundError: No module named 'certbot'
-
I got stuck and wrote this post and redid everything to document my steps.
-
When I reached the last step, I spotted this
The command could not be located because '/snap/bin' is not included in the PATH environment variable.
part which I missed last time. -
I attempted to run certbot again:
/snap/bin/certbot
-
It worked.
-
I realized that I am using Fish.
-
I added /snap/bin to Fish paths by running:
set -ga fish_user_paths /snap/bin
Just posting to let you guys realize what I was going through “thanks” to the fact that Certbot had moved from PPA to Snap and to help others using Fish, too.