Ownership of .Xauthority transferred to root

Almost certainly not, no. You either started an X session as root (not sure how you managed that) or simply used touch or otherwise wrote .Xauthority with sudo. For more details, you'd have to explain what you were actually doing.

Next time, don't reinstall anything, just delete the ~/.Xauthority file, it will be recreated automatically next time you log in:

sudo rm ~/.Xauthority

Then log in normally.


It happened to me too. I think that it could be caused by running

sudo graphic_application

instead of

gksudo graphic_application 

for some (unknown) app. There is a paragraph in the sudo help page about that... scroll down to "Graphical sudo".

See also What is the difference between "gksudo nautilus" and "sudo nautilus"?