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

This question already has an answer here:

I chowned -R username /usr/lib and now i cannot sudo or do any thing really due to sudoers.so belonging to username.

How do i fix this and make /usr/lib owned by root again?

share|improve this question

marked as duplicate by muru, heemayl, roadmr, Eric Carvalho, Seth Jun 20 at 3:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3 Answers 3

  1. Reboot the system to enter grub. Select recovery mode. Enter root shell
  2. Remount the system with read/write permissions: mount / -o rw,remount
  3. Run chown -R root:root /usr/lib. Once done, reboot.
share|improve this answer
    
This is not right..not all the direcories/files under /usr/lib are root owned so simply running chown again won't resolve this..this is a failrly complex situation.. –  heemayl Jun 19 at 18:43
    
@heemayl I've ran ls -l /usr/lib/* | less all files are owned by root. group ownership was all root, except drwxr-xr-x 2 root utempter 4096 Feb 18 21:48 utempter. For that directory the group ownership was root. That's all. This should fix most of the problem –  Serg Jun 19 at 19:19
    
You are doing recursion..there are thousands of files under that sublevel..how can you be sure of them all? –  heemayl Jun 19 at 19:22
    
find /usr/lib -ls | awk '{print $5" "$6}' | grep -v root also no problem –  Serg Jun 19 at 19:23

Try with one of the following :

sudo chown [USERNAME]:root /usr/lib

Or

sudo chmod 0755 /usr/lib

Use option -R with chown if its just for recursive.

share|improve this answer
    
sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0 sudo: fatal error, unable to load plugins this is the error it gives me. I also cannot boot into recovery mode by holding shift. I think its because this instalation has been done on top of a w8 OEM laptop. any ideas? –  Henrik Harju Dec 12 '13 at 17:35
    
No. Someone has given that file ownership to the user with chown without -R. Before reinstall, just try with pkexec chown root /usr/lib/sudo/sudoers.so or pkexec chmod go-w /usr/lib/sudo/sudoers.so –  user224082 Dec 12 '13 at 17:54

It's very easy! Boot with Instalation CD (Ubuntu), and go to /media/ubuntu/(your disk Ubuntu), then execute:

sudo chown root -R /usr/lib
share|improve this answer
2  
This is not right..not all the direcories/files under /usr/lib are root owned so simply running chown again won't resolve this..this is a failrly complex situation.. –  heemayl Jun 19 at 18:42

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