1

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?

3
  • 1
    You will need to boot into a live system, mount your disk, and change ownership. You're probably lucky, as ownership of files under /usr/lib is most probably all root. 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, 2018 at 22:03
  • I think you have pointed me in the right direction, thank you. Is "boot[ing] into a live system" the same as booting into recovery mode? Oct 14, 2018 at 22:14
  • 1
    Oh sorry for the confusion, no you don't need to boot into a live system. Recovery mode is enough. I was mistaken there. No, they are not the same by the way, to boot into a live system, it means you boot another Ubuntu instance from a USB pen drive or from a disk drive.
    – Dan
    Oct 14, 2018 at 22:21

0

Browse other questions tagged .