Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 11.04 installed in my computer, and I decided to install 12.04 from CD in a new partition, but having only one /home partition shared by both systems.

Installation went ok, but when I enter my password the screen turns black and returns to the login screen half a second later.

I can log in as guest. I can also login at the cmd prompt (going to tty with Alt+Ctrl+F1) with my normal user credentials. When logged in as guest I can also install programs using my normal account password.

LinuxIsMyFriend had the same issue, and he answered the issue himself saying

When I created my new user (with the same name as the old one) I got the correct home directory but wrong UID and GID. When I changed it to the correct values everything worked again!

I'd like to do what LinuxIsMyFriend did, but I do not how. My question is, what should I do to set the proper UID and GID in the 12.04 install?

share|improve this question
up vote 1 down vote accepted

I ran out that bug this morning, and it seems that I had some file under my /home/ dir wich were associated to root ownership (in this case, .Xauthority and other ones). I changed owner of .Xauthority to my username and it works now.

While I wrote this I saw other similar posts on this website, it's not a 12.04 problem, but the bad guy is always this .Xauthority. Deleting it or changing owner seems working

@see Can't login after installing 11.10

share|improve this answer

Boot up a rescue cd, which could be ubuntu or not, then mount both roots, edit /etc/passed of the new version so that the uid of the user equals that of the old version. Do the same with /etc/group. Now you boot into 12.04 you should have no home directory issue, assuming your passwd is correct. If you are not sure, you can copy the old passwd from /etc/shadow and put in the new version file, while you fixed uid and gid.

share|improve this answer
I checked both passwd and group file, and UID and GID are the same there. I also did copy the shadow files from the 11.04 system to the 12.04 one. Still the same situation. – Alejandro Greppi Apr 30 '12 at 18:45

Your Answer


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.