I ran a stupid command: sudo chown -R ngoclb:ngoclb /usr
.
Then I couldn't use sudo command and login to Ubuntu.
To fix this issue, I using recovery mode to chown /usr
to root (sudo chown -R root:root /usr
) and can logged in to Ubuntu, but now, the GUI of Ubuntu is not like default (it's same like Windows classic for some component: scrollbar, menu...) and I cannot access to System Settings/User Account.
How can i fix this ?
Asked
Active
Viewed 3,978 times
0

muru
- 197,895
- 55
- 485
- 740

Ngọc Lương
- 93
-
6Reinstall. It's the easiest way. – muru May 22 '15 at 13:15
-
Don't drink and root, Sorry. =) – A.B. May 22 '15 at 15:19
1 Answers
1
Almost everything in /usr
is owned by root:root
I run find /usr -not -gid 0 -printf "%M\t%u\t%g\t%p\n"
here using 15.04 and the output is
-r-xr-sr-x root postdrop /usr/sbin/postqueue
-rwsr-xr-- root dip /usr/sbin/pppd
-r-xr-sr-x root postdrop /usr/sbin/postdrop
drwxrwsr-t root lpadmin /usr/share/ppd/custom
drwxrwsr-x root staff /usr/local/share/xml
drwxrwsr-x root staff /usr/local/share/xml/declaration
drwxrwsr-x root staff /usr/local/share/xml/entities
drwxrwsr-x root staff /usr/local/share/xml/schema
drwxrwsr-x root staff /usr/local/share/xml/misc
drwxrwsr-x root staff /usr/local/share/emacs
drwxrwsr-x root staff /usr/local/share/emacs/site-lisp
drwxrwsr-x root staff /usr/local/share/sgml
drwxrwsr-x root staff /usr/local/share/sgml/declaration
drwxrwsr-x root staff /usr/local/share/sgml/entities
drwxrwsr-x root staff /usr/local/share/sgml/dtd
drwxrwsr-x root staff /usr/local/share/sgml/stylesheet
drwxrwsr-x root staff /usr/local/share/sgml/misc
drwxrwsr-x root staff /usr/local/share/ca-certificates
drwxrwsr-x root staff /usr/local/share/fonts
drwxrwsr-x root staff /usr/local/lib/python3.4
drwxrwsr-x root staff /usr/local/lib/python3.4/dist-packages
drwxrwsr-x root staff /usr/local/lib/python2.7
drwxrwsr-x root staff /usr/local/lib/python2.7/dist-packages
drwxrwsr-x root staff /usr/local/lib/python2.7/site-packages
drwxr-xr-x root utempter /usr/lib/utempter
-rwxr-sr-x root utmp /usr/lib/utempter/utempter
-rwxr-sr-x root mail /usr/lib/evolution/camel-lock-helper-1.2
-rwsr-xr-- root messagebus /usr/lib/dbus-1.0/dbus-daemon-launch-helper
-rwxr-sr-x root utmp /usr/lib/libvte-2.91-0/gnome-pty-helper
-rwxr-sr-x root crontab /usr/bin/crontab
-rwxr-sr-x root tty /usr/bin/wall
-rwxr-sr-x root tty /usr/bin/bsd-write
-rwxr-sr-x root shadow /usr/bin/chage
-rwxr-sr-x root shadow /usr/bin/expiry
-rwxr-sr-x root mail /usr/bin/mail-unlock
-rwxr-sr-x root mlocate /usr/bin/mlocate
-rwxr-sr-x root mail /usr/bin/dotlockfile
-rwxr-sr-x root mail /usr/bin/mail-touchlock
-rwxr-sr-x root mail /usr/bin/mail-lock
-rwxr-sr-x root ssh /usr/bin/ssh-agent
-rwsr-sr-x daemon daemon /usr/bin/at
and given the output, I don't see what you might have wrong to get what you describe. May be the dbus stuff...
But you can nonetheless manually chown the above file to try to get your ubuntu back.
you might not have the same files or I may miss some of your files, so even if you manually chown the files above, you're not entirely finished with it.

solsTiCe
- 9,231
-
I fixed this issue by upgrading Ubuntu from 14.04 to 14.10. Thanks for all !! – Ngọc Lương Jun 05 '15 at 07:41
-
Thank you for the great information. It actually bailed me out here. Somehow my permissions had changed, so I thought that they were all supposed to be root:root. Oops! I had to manually reset the files to the groups and permissions but it saved an entire reinstallation and seems to be working very stable. =) – Terrance May 27 '16 at 04:34