Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Whenever I try to do anything at all that requires my password it returns this:

u7ur7l3@ubuntu:~$ sudo
sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0
sudo: fatal error, unable to load plugins
u7ur7l3@ubuntu:~$

So I can't install anything from the Software Center / package manager or run any commands in terminal that require my password. I can log in, but that's pretty much it.

I accidentally changed the permissions of some files, then changed some more trying to fix it :/. Now I'm completely lost as to what to do.

This is what happened when I tried to get sudo working again using pkexec:

u7ur7l3@ubuntu:~$ pkexec chown root /usr/lib/sudo/sudoers.so
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program /usr/lib/dbus-1.0/dbus-daemon-launch-helper: Success 

u7ur7l3@ubuntu:~$ sudo ls
sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0 sudo: fatal error, unable to load plugins

And to change permissions I was using Root Actions as a dolphin service/ plugin thing, so history doesn't show me the permission changes.

I just realized that sounds don't work at all anymore. When I go into Phonon my default settings and playback devices aren't even there. Also I don't have the option to shutdown, I can only log out or leave.

share|improve this question
    
Is the sound and shutdown problem new since you ran the pkexec command? –  Eliah Kagan Apr 2 '13 at 14:49
    
@Eliah Kagan, no I realized the sound issue right when I logged on to my computer, and I realized the shutdown issue when I was turning my computer off last night. I ended up just holding down the power button. –  7UR7L3 Apr 2 '13 at 14:52
    
I've expanded my answer to provide instructions that should work even though neither sudo and PolicyKit (via pkexec) work. –  Eliah Kagan Apr 2 '13 at 17:23
    
su root chown -R root:root /usr/lib/ –  user288751 Jun 5 at 15:05

2 Answers 2

Ownership of at least one of your important system files is wrong. That's a bad thing; if this has happened to many system files (perhaps you ran a big sudo chown command with the -R flag at some point?), it could cause a number of other system errors and instabilities. So if you recently installed Ubuntu, you might want to reinstall as Adam Heathcote suggests.

But you do not have to reinstall to fix this problem. Instead, just fix the ownership on that file. If you get errors about other files after that, you can fix them too (though you might have to tell us what the error messages are, so we can tell you how to fix them also).

sudo does not work, but using sudo is one of two ways for administrators to perform actions as root on Ubuntu. The other is PolicyKit.

Run this command, which uses PolicyKit (via pkexec) to change the ownership of /usr/lib/sudo/sudoers.so back to root (i.e., uid 0):

pkexec chown root /usr/lib/sudo/sudoers.so

Then try using sudo again. You can run something trivial like sudo ls, and see if you get an error message.

Finally, I recommend running history to reveal all the commands you've run. Hopefully that will list all the commands you've run that have changed permissions. Assuming sudo now works, I recommend posting a new question including the output of history, to get help undoing all the file ownership and permissions changes you've done.

If pkexec doesn't work either...

You tried pkexec and it didn't work. Since neither sudo nor PolicyKit is working to allow you to perform actions as root, you'll have to boot into recovery mode and get a root shell. To do this, hold down Shift while booting up your computer, to ensure you get a visible GRUB boot menu. Select an entry that contains the words recovery mode (generally, you should select the one closest to the top that has those words). Then you'll get a menu where you have a number of options--select the option to drop to a root shell.

Detailed instructions on accessing a root shell in recovery mode are here:

Once you have a root shell, run:

chown root /usr/lib/sudo/sudoers.so

If you get an error about the file or filesystem not being modifiable, then remount it readwrite:

mount -rw -o remount /

(Source for the idea of remounting and how to do it: this mostly unrelated answer.)

Then after running that mount command, run the above chown command again and see if it works.

Once you're done in recovery mode you can reboot by running:

reboot

sudo should then work, or at least give some other error.

Finally, please note that given the errors you showed, it's likely that many files now have the wrong ownership or permissions. It would be ideal if you could figure out which files you modified in this way. For example, if you could figure out that it was all files in a couple specific folders, then it might be possible to correct the complete extent of the recent problems you've been having.

Reinstalling is definitely an option, but especially if all you changed was ownership (and not permissions, which are somewhat harder to reconstruct as they vary more), it should be possible to simply set the permissions back recursively to their original owners (probably usually root) and reverse the damage entirely.

Getting sudo working again is a first step. Hopefully the above technique will enable you to do that.

share|improve this answer
    
I followed those instructions but when I booted back into kubuntu to problem still existed. Same error. At this point it's probably easier to just re-install. :/ –  7UR7L3 Apr 6 '13 at 16:25
    
Also, is there any way I can do something like this: askubuntu.com/questions/9135/… to save everything? The all together as a pseudo-bash script won't work because sudo is involved so.... –  7UR7L3 Apr 6 '13 at 16:50
    
@7UR7L3 That will back up information about what packages are installed, and most information about your programs' systemwide settings. In combination with a full backup of your home directory, that should enable you to restore things mostly to the way they were, after removing the existing system and installing a new one, yes. Please make sure to have a backup of all truly important files (like your documents) at all times. If you find you need more information about that technique as applied to your situation, I suggest posting a new question (but I don't mind if you ask in comments here). –  Eliah Kagan Apr 6 '13 at 16:53
    
Is there a good way to go about all this? I have a 1 TB external drive that I can back up stuff to, but It won't appear anywhere when I plug it in. It's light is on to show that it works but nothing on the screen is changing and it's not anywhere in dolphin. Then once I get that working how should I go about saving everything to it. In the package manager I could save the installed packages to a text document, but that's really all that I've figured out to do to save information. Pretty much all other solutions involve sudo which still won't work. –  7UR7L3 Apr 6 '13 at 17:03
    
@7UR7L3 For backing up files? Boot from a live CD/DVD or live USB. You can access your files from there, and back them up to your external drive. If your external drive doesn't appear in the live system either, then that's a totally separate problem which I might not be able to help you with and almost certainly couldn't within the confines of comments. So if that happens, I recommend posting a new question. If you comment here with a link to the new question, I'll make sure to look at it and contribute if I can. –  Eliah Kagan Apr 6 '13 at 17:04

You would probably have to reinstall unless you set the root password before this happened. In which case you can SU too root and just change the Owner using the CHOWN command. If you didn't change the root PW then you have no way to achieve root access.

share|improve this answer
    
Reinstalling may make sense as many files were altered. Reinstallation may be easiest. But this is not related to whether or not the root password is set. It is not true that "If you didn't change the root PW then you have no way to achieve root access." Recovery mode or chrooting from a live CD both facilitate root access. See this question for such methods. Furthermore, it's best to avoid recommending enabling the root account without at least explaining why it is disabled by default. See RootSudo. –  Eliah Kagan Apr 6 '13 at 16:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.