To remove the old SSL certificate installed on my system in order to install a new one with Certbot

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. |, so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command: sudo certbot --nginx

It produced this output: sudo: certbot: command not found

My web server is (include version): Gunicorn & Nginx

The operating system my web server runs on is (include version): Ubuntu 22.04 LTS

My hosting provider, if applicable, is: AWS

I can login to a root shell on my machine (yes or no, or I don't know): Yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):

You do not need to "remove" the old cert. Just get a new one and install it in your new system

It looks like certbot is not yet installed on your new system. See below for install:


I followed the instructions but it made me confused. it says "certbot is already installed" but when I command "sudo certbot --nginx" it says "sudo: certbot: command not found"

When I tried to install the certificate at the first time, it works fine and I got the questions which website name I am going to choose but I saw old website name was there, so I cancelled the process. after this, I deleted the file of certbot manually in the terminal. after this, I tried to install it again. but this happened.

That is NOT how programs are uninstalled.
You many need to uninstall it using the same method you installed it with.
Then reinstall it.


Can you please let me know how to uninstall properly


1 Like

That would be dependent on which method was used initially to install Certbot.

1 Like

I just followed the instructions

Nginx and ubuntu 22.04

Try showing:
history | grep -i certbot


Thanks it was solved


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