The shell says certbot is not found after you followed an old tutorial
certbot: command not foundShort answer
Command not found means no certbot program is on your PATH. Certbot's own docs recommend installing it as a snap on systemd distributions. Old guides used certbot-auto, which is deprecated and has to be removed. Install the snap with the classic flag, then open a new shell and run certbot --version.
Fix it fast
1Find out which cause you have
Check whether any certbot exists, and which package system owns it.
command -v certbot || echo "no certbot on PATH" snap list certbot 2>/dev/null ls /usr/local/bin/certbot-auto 2>/dev/null2Match what you see, then jump to its fix
What does the error look like?
certbot: command not foundsudo: certbot: command not found
Cause 1 of 2
Certbot is not installed
1Check
Snap is the recommended install for most modern Linux distributions that use systemd. Third-party packages are maintained outside Certbot and often fall behind on LTS distributions.
snap version2Fix
Install the snap (classic confinement), then run it by name.
sudo snap install certbot --classic3Verify
Open a new shell and print the version.
certbot --versionConfirmed by snapcraft.io
Cause 2 of 2
An old tutorial installed certbot-auto, which has been deprecated
1Check
The Certbot docs list certbot-auto as deprecated and give removal steps: delete its cron entry or timer, the script, and the /opt/eff.org installation.
grep -rn certbot-auto /etc/crontab /etc/cron.d 2>/dev/null2Fix
Remove certbot-auto as documented, then install the snap as above.
sudo sed -i '/certbot-auto/d' /etc/crontab
sudo rm /usr/local/bin/certbot-auto
sudo rm -rf /opt/eff.org3Verify
The old script is gone and the new command is found.
ls /usr/local/bin/certbot-auto 2>&1
command -v certbotConfirmed by eff-certbot.readthedocs.io
How do I stop it coming back?
- Follow the instructions at certbot.eff.org for your server software instead of an old tutorial.
- Check certbot certificates after installing to see what is already issued.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Servers
dnf cannot install MySQL on Amazon Linux 2023
dnf cannot find a mysql-server package on Amazon Linux 2023
Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.
3 causes, each with a fixServers
Ansible hangs, then times out waiting for the sudo prompt
a playbook using become seems to hang
Ansible ran sudo on the target and never saw the answer it expected.
3 causes, each with a fixServers
Apache on Ubuntu returns 404 Not Found for my site
The requested URL was not found on this server.
On Ubuntu a 404 from Apache usually means the request maps to a path that has no file.
3 causes, each with a fixServers
Apache returns 504 Gateway Timeout when PHP takes too long
Quick requests work, slow ones end in a 504 after a fixed wait
A 504 from Apache means the backend did not answer within the proxy timeout.
2 causes, each with a fixServers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
Apache warns that a ${VAR} config variable is not defined
${VAR} left unchanged in the configuration, with a warning in the error log
Apache expands ${VAR} from Define or from the shell environment that exists when the server starts.
3 causes, each with a fix