Let's Encrypt, as a certificate issuing organization, is free and can be automatically renewed. It is a must-have for small and medium-sized enterprises and personal webmasters, so there is no need for much introduction.
Recently, on a new server, I encountered a problem in applying for a certificate through the Let's Encrypt script.
Running the script prompts that the system is no longer supported. My system is CentOS7.8. It shouldn’t. After some searching, the release update of certbot in github has instructions as follows
Because certbot was developed based on python2, python2 is not maintained now, and the whole migration of certbot to python3 is time-consuming and laborious, so I decided not to maintain it anymore.
In the document, the certbot team gave a new installation method, that is, a new distribution method through snap
Briefly talk about snap. Snap is a new software format created by the parent company of Ubuntu for software packaging and deployment. It is essentially different from dpkg/apt. It is "self-contained" and is not correct on the platform. With any dependency and influence , it is similar to a container owning all the files and libraries of an application, and each application is completely independent. So the advantage of using the snap package is that it solves the dependency problem between applications and makes it easier to manage between applications. But the problem with this is that it takes up more disk space
So now to install let's encrypt, you need to install snap first. For CentOS systems, snap is in the epel source and can be installed through yum
After the installation is complete, pass
systemctl enable --now snapd.socket
Enable snapd service
The default snap software package is generally installed in the /snap directory, usually after installation, this directory does not exist, the corresponding directory is /var/lib/snapd/snap, through the ln soft link to /snap
Then update the snap to the latest version through the command
snap install core
snap refresh core
Certbot can now be installed via snap
snap install --classic certbot
After the installation is complete, you can see the certbot installation package in the /snap directory. The executable commands of certbot are in the bin directory. For ease of use, you can use the soft link to soft link bin/certbot to /usr/bin/certbot
Now certbot can continue to be used