I was doing some alterations but in one I messed up.
I changed the permissions of almost everything inside the /usr
folder to my own user. It didn't change everything because it failed in the middle of the execution, I still have /sbin
, /share
and /src
assigned to root.
the command I ran was this (this was executed while inside /usr):
sudo chown -R myuser:myuser .
Is there any way for me to revert this?
If I run:
sudo chown -R root:root .
I get this error:
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
You cannot just chown -R the /usr partition, because not everything in that partition is owned by root. It sucks, you'll have to reinstall everything, but the only safe solution is to do a reinstall or recover from a backup.
It does suck to do a complete re-install. that is certainly one option. However, most of the files in /usr/bin ARE root:root. These are the only ones which aren't:
for a standard install. In /usr/sbin it's:
in /usr/lib/
in /usr/local/share
and in /usr/local/lib any python directories, e.g: