I use a Ubuntu 16.04 with Nginx and Certbot.
I tried to execute, for example:
none gave any relevant output. How could I know the version currently installed in my Ubuntu?
Ubuntu Trusty and Ubuntu Xenial both do not have
certbot installed by default. To get Certbot, you had to be using the Certbot PPA maintained by the Certbot developers.
If you are not using the PPA (which you would have installed using
sudo add-apt-repository ppa:certbot/certbot), you don't have Certbot.
To get Certbot, you should read through the instructions on the Certbot Website by choosing your specific release, and then follow the guide to set up Let's Encrypt.
At the time of this post, Ubuntu releases 16.10 and 17.04 are past End of Life and not included for this answer.
As of 17.10 (and potentially earlier, see my note above), Certbot is included in the repositories.
And if you are on older Ubuntu (14.04 or 16.04), and you are using the PPA, then
certbot is available.
To find the version of Certbot installed, you can use
apt-cache policy certbot | grep Installed to get the information, as shown below (note that the version information shown below is accurate as of April 10, 2018 at 12:18, on a brand new 'certbot' installation):
$ apt-cache policy certbot | grep -i Installed
As you can see, version 0.22.2 is installed on this computer here, which is a 16.04 machine using the Certbot PPA.
2020 (at least) and beyond:
Certbot is now compiled as a
snap package, and the certbot PPA is more or less deprecated in favor of the snaps. As a result, if you are using snaps for Certbot, you're going to have the latest whenever the system runs automatic updates and updates your snaps.
If you did not get the certbot with
apt like @Thomas Ward said, you will get it with the
wget command as a stand-alone application instead.
Try this command below:
sudo /PATH/TO/certbot-auto --version