I made a terrible mistake. I realized it right after I did it, but now it is too late.
I ran this command:
sudo chown -R $USER /usr/lib
and I tried to fix it with:
sudo chown -R root /usr/lib
but I get this error:
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0
sudo: fatal error, unable to load plugins
I tried to log in as root with:
su
but authentication failed every time. I'm 99% sure I have my password right.
I figured I owned the files now, so I also tried:
chown -R root /usr/lib
But the operation fails. I get what appears to be a long list of an the same error for changing the permission of every file. Each line looks like this:
chown: changing ownership of 'lib': Operation not permitted
Is there anything I can do to save myself?
/usr/lib
is most probably allroot
. So it should be a relatively easy fix, granted you boot into a live system. You should be able to find more info (by order of importance to your case), here, here, here and here. – Dan Oct 14 '18 at 22:03