I used sudo gedit
before I learned that I am supposed to use gksudo gedit
. The side effect of this error is that some files change ownership. There seem to be 3 candidates in this screenshot that may exhibit the problem. Is there something wrong with the ownership listed here or do I need to wipe out Ubuntu, reformat, and reinstall? Is it possible to repair the ownership situation and if so, which files now have incorrect ownership? How deep does the ownership problem go? All directory levels? Is the screenshot of the ~
directory sufficient to diagnose what happened or do more directory levels need to be examined and corrected? A reformat would be inconvenient so I'm hoping there is a programmatic fix.

- 9,693
-
"Is there something wrong with the ownership listed here or do I need to wipe out Ubuntu, reformat, and reinstall?" This is almost never necessary, particularly when you've made a minor, easy-to-make mistake. – Olathe Jan 02 '16 at 06:40
2 Answers
Is there something wrong with the ownership listed here or do I need to wipe out Ubuntu, reformat, and reinstall?
Yes. But you don't need to re-install.
Is it possible to repair the ownership situation and if so, which files now have incorrect ownership? How deep does the ownership problem go? All directory levels?
Yes. A command to find them is given in What is the difference between "gksudo nautilus" and "sudo nautilus"?:
find $HOME -not -user $USER -exec ls -lad {} \;
Is the screenshot of the
~
directory sufficient to diagnose what happened or do more directory levels need to be examined and corrected?
Since everything in $HOME
should be owned by you, this is sufficient.
One command to fix the ownership would be:
sudo chown $USER:$(id -g) -R ~
id -g
prints your primary group name.
Or, you could adapt the file-listing command mentioned above to do only necessary chowning:
sudo find $HOME -not -user $USER -exec chown $USER:$(id -g) {} +
-
Even with a sudo inserted before chown this is the error. chown: changing ownership of ‘~/.gvfs’: Function not implemented – H2ONaCl Jan 01 '16 at 20:13
-
Do you have anything mounted using GVFS? A network drive mounted using the file manager, or something like that? – muru Jan 01 '16 at 20:27
-
-
@H2ONaCl Well, since you re-installed Ubuntu, there's nothing I can do to help. In any case, have a look at http://unix.stackexchange.com/a/77592/70524. Essentially that
.gvfs
permissions are messed up indicate that there is something mounted there, and it is mounted by another user - likely root, since you usedsudo
with GUI programs. – muru Jan 02 '16 at 20:12
To fix this, you would run:
sudo chown -R brian:brian ~
For other people, replace both instances of brian
with your username.

- 4,240