/usr/bin/certbot or /usr/local/bin/certbot?

I have two certbots installed on a Ubuntu 16.06 VPS, running nginx. They are:

/usr/bin/certbot --version
certbot 0.21.1

/usr/local/bin/certbot --version
certbot 0.14.2

Which one is correct, and how do I uninstall the other??

Much thanks.

the output from command
"which certbot"
should tell you

“which certbot” give me /usr/local/bin/certbot. but the version is older than /usr/bin/certbot. Any idea how to properly uninstall one or the other? I sadly don’t recall whether it was apt-get, or a github pull, etc., and I am afraid that uninstalling the wrong one will affect the correct one.

Hi @scooke!
Try command : " sudo apt-get up certbot " no quotes
Should work for you I think.


Is that update, or upgrade? On my Ubuntu 16.04 VPS " sudo apt-get up certbot " gives me E: Invalid operation up

sudo apt-get up certbot OR sudo apt-get update certbot will achieve the same results.

use update or up … up is alias or shorthand for update, so to speak.

/usr/local/bin/certbot is the result of installing Certbot from pip (pip install certbot).

/usr/bin/certbot comes from python-certbot from the Ubuntu Certbot PPA.

You probably want the latter.

You could try uninstalling certbot from pip and seeing if that helps.

1 Like

Running sudo apt-get update certbot gives me 'E: The update command takes no arguments'. So I just ran sudo apt-get update, then sudo apt-get upgrade certbot, and it did indeed upgrade /usr/bin/certbot, but I still have /usr/local/bin/certbot version 0.14.2 hanging around in /usr/local/bin/.

Thanks for hte reply. I strangely get an error ‘-bash: pip: command not found’. But I must have (had) it since it was used to install the /usr/local/bin version. Not sure what to do.

If the following query comes up empty, I would just delete the file and get on with your life:

dpkg -S /usr/local/bin/certbot

this is just not my day. This is what returns, 'dpkg-query: no path found matching pattern /usr/local/bin/certbot'. I suppose I could just sudo rm /usr/local/bin/certbot?

Your “rogue certbot” wont hurt anything for now… One of the forums experts might help you figure out which package management app installed the other certbot, although that’s a bit out of scope…

Can you give us some information about your configuration so we can help?
Operating System?
Web Server?
Virtual Hosts?

This info makes a huge difference in the way you would invoke certbot commands.


Ok, thank you for the help.

At the moment it is the rogue certbot which is the one used when I run sudo certbot --nginx -d domain.com. But it fails. But when I run sudo /usr/bin/certbot --nginx -d domain.com then it works fine. My question is how can I permanently change to the /usr/bin/certbot rather than /usr/local/bin/certbot? I think if I just rm /usr/local/bin/certbot then running sudo certbot --nginx -d domain.com wont run at all since it won’t find the currently reference certbot.

Whenever you’re worried deleting something might be bad, you should always make sure you have a backup. The mv command performs a great backup of first or last resort. :grinning:

The certbot file is just a tiny script that points to a larger set of libraries. But if you aren’t worried about the wasted disk that might leave than removing/moving the not-working certbot command should be totally fine.

Depends – if the rogue Certbot installed a ton of Python modules in /usr/local/lib, that could cause problems now or in the future.

If it’s a copy of certbot-auto, it installed everything in a separate location, so it may be a waste of disk space but it won’t cause any (other) harm.

1 Like

To be sure about that, we should see what Python installation these certbots use:

head -n2 /usr/{local/,}bin/certbot

I’m pretty sure if there was a sys.path conflict python-certbot 0.22 wouldn’t work due to python-acme 0.14 missing ACMEv2 classes though.

Running that gave me:

==> /usr/local/bin/certbot <==

EASY-INSTALL-ENTRY-SCRIPT: ‘certbot==0.14.2’,‘console_scripts’,‘certbot’

==> /usr/bin/certbot <==

EASY-INSTALL-ENTRY-SCRIPT: ‘certbot==0.22.2’,‘console_scripts’,‘certbot’

I just went ahead a ran mv and moved the certbot from /usr/local/bin to another folder, then ran certbot --version, and it gave me the newest version which is in /usr/bin/! This is what I was aiming for but was overcomplicating things I guess.

1 Like

These use different major versions of Python so the old one shouldn’t bother anything.

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