MacOS – sudo: effective uid is not 0, is sudo installed setuid root

macospermissionrootsudo

I was trying to remove some folders (python) via sudo rm in Terminal and got this message:

sudo: effective uid is not 0, is sudo installed setuid root?

I already tried to verify/repair disk permissions (only shows 1 error, apple's remote agent), but that didn't help.

$ sudo
sudo: effective uid is not 0, is sudo installed setuid root?

$ type sudo
sudo is hashed (/usr/local/bin/sudo)

$ ls -@@eil /usr/bin/sudo
2215747 -r-s--x--x  1 root  wheel  164560 Sep 10  2014 /usr/bin/sudo

$ md5 /usr/bin/sudo
md5: /usr/bin/sudo: Permission denied

OS X 10.10.4

Best Answer

For whatever reason, you have a sudo installed in /usr/local/bin (see the output of type). Did you install something with homebrew or another package manager?

To fix, run

/usr/bin/sudo mv /usr/local/bin/sudo /usr/local/bin/sudo-strange

or (if you want to get rid of it completely)

/usr/bin/sudo rm /usr/local/bin/sudo