Skip to content

Instantly share code, notes, and snippets.

@cookie-ag
Created October 19, 2017 01:08
Show Gist options
  • Save cookie-ag/f13bcf74f0e25c59aed54b00a18de6fc to your computer and use it in GitHub Desktop.
Save cookie-ag/f13bcf74f0e25c59aed54b00a18de6fc to your computer and use it in GitHub Desktop.
Fixing: sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
- Problem: sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
- Cause of this: sudo chown -R $(whoami) /usr/{lib/node_modules,bin,share}.
- Explaination of the root cause:
- "chown -R": change file owner and group information. Use the chmod command to change file access permissions such as read, write, and access.
- "$(whoami)" : Throws the present user
- "/usr": Only the folders {node_modules,bin,share} will have user rights as tp
- The "/usr" directory should have "root" as user.
Solution: The Chown cannot be reverted, so re-install is the safest way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment