Is sudo apt install a valid way to install Certbot?

My domain is:wulicoco.online

The operating system my web server runs on is (include version): Windows Subsystem for Linux 2

Hi, everyone.
I have read instructions about certbot.
I found that if I select manual and ubuntu 20.04, the instructions suggest me to install certbot through snapd.
But as you can see, I am using WSL2 right now and snapd seems not work correctly.
Can I try sudo apt install certbot to get the latest version?

I would do that.
Then let's see which version it gets with:
certbot --version
[which should be new enough to handle ACMEv2]

Alternately (and not an actual recommendation; as I haven't used either of these), you might want to test out this "hack" that allows you to install snapd on WSL2:

1 Like

Hi, thank you for your prompt reply.

certbot --version told me that its version is certbot 0.40.0 which I think is far behind latest version 1.16 I guess.

1 Like

Thank you for your link. I have also followed this thread on GitHub for some days.

It seems that there isn't yet a perfect solution to enable snapd on WSL2 right now.

I am going to try some other solutions such as docker.

1 Like

You could also try the pip method. Not sure if it works on WSL2 tho, but worth a try.

1 Like

I would try pip first. Certbot is just a standard Python package.

@jvanasco @Osiris I also noticed the pip way.
It is described like this:

Installing Certbot through pip is only supported on a best effort basis and when using a virtual environment.

What does this sentance mean?

It means the recommended method is probably using "snap", but the "pip" method is offered as an alternative. Though not as thoroughly supported. The virtual environment is a Python thing and the commands for setting it up are included in the "pip" instructions.

1 Like

pip is really a backup method to using certbot. Certbot is just a normal Python package, but managing the virtual environment and keeping it up to date is an effort for those unfamiliar with Python. The other installation methods automate all this.

In this situation, there doesn’t seem to be any preferred method of installation that is compatible, so ‘pip’ is a decent candidate to explore.

2 Likes

Thank you! Appreciate for the answers. Now it's much clear for me now.

2 Likes

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