I changed the ownership of my
/usr directory to
777 by mistake and now my system give this error whenever I try to use sudo:
sudo: setuid must be root
This question came from our site for professional and enthusiast programmers.
Based on your error, you didn't simply changed the permissions of /usr to 777, you did it recursively which is a more serious and problematic change.
Unless you have backups of your system directories, your best option is just to reinstall.
Go to recovery console (reboot, and chose recovery console ) and type
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo