Ubuntu 20.04 - Can’t log in after upgrade

34,906

Solution 1

Weird. Same problem, but Ctrl+Alt+F4 changed it to my logged-in desktop

Solution 2

I once or twice had problems logging in with my account. Removing/renaming one of the (desktop?) configuration settings solved the problem. I can't remember exactly and I can't check right now, but I think it was the ~/.config/lxsession folder.

Solution 3

Suggesting more potential solutions.

Try logging in via the text console (CTRL+ALT+F1) which tries to do fewer things than the graphical login. If you cannot login via the text console, then the problem might be an actual password typo or a keyboard layout issue. If you need to change your password, reboot into recovery mode in the grub menu, choose "drop to root shell", and run passwd myuser.

If your text console login works, but you can't login via the graphical interface:

  • Be mindful of the keyboard layout active when you enter your password. you can change the default layout of the linux console by following steps in https://superuser.com/a/404507/525084 .
  • If you've reused your /home directory from a previous installation, and you changed your password in the new install, you won't be able to mount any encrypted home filesystem and the graphical desktop will boot you out right away. If you use an encrypted /home, you'll have to re-wrap your ecryptfs configuration to recognize the new password (see how to change password of an enrypted ubuntu user account?).

Solution 4

Quite a few people have had this issue, also with previous versions.

None of this worked for me. My problem was a wrong user ID and the fix is simple.

To find out whether your login problem has the same cause

echo $USER $UID
     NEWUSER 1000

This showed the NEWUSER had ID 1000, but the files in the directory had a different ID.

  ls -n  roots.jpg           # in the new home directory on some files
    -rw-rw-r--  1 1001 1001 102869 Jan  6  2019  roots.jpg

This shows that the files were owned by OLDUSER with ID 1001.

This fixed it for me

  sudo chown -R NEWUSER:NEWUSER *
  sudo chown -R NEWUSER:NEWUSER .*   # to include hidden files and directories

Here is what had caused my problem: The user I made the fresh install for [let's say NEWUSER] was not the same user under which I had installed Ubuntu the last time [OLDUSER]. This happened because the last time I installed Ubuntu it was under OLDUSER, then I added somebody else afterwards, called NEWUSER. This time I installed for NEWUSER only. Ubuntu assigns the first user the ID 1000. As a result the user IDs were now different, and with it the permissions to log onto the desktop, which is why the graphical login failed. In my case OLDUSER was 1001, NEWUSER was 1000.

An emergency fix that allowed graphical login was

sudo mv .local .local_old

Note that this will not fix your application and file settings and should only be used for a quick GUI peak.

Share:
34,906

Related videos on Youtube

Whitehotburn
Author by

Whitehotburn

Updated on September 18, 2022

Comments

  • Whitehotburn
    Whitehotburn over 1 year

    I installed 20.04 (upgraded from 18.04) and cannot log in at all. I’ve tried changing my password using recovery mode, installing lightdm, and using Ctrl-Alt-F3.

    Strangely, when using Ctrl-Alt-F3, I can log in as root, but not into my personal account. Even after I change the password to my personal account using the command line in recovery mode, I can’t log in to my personal account. I can log in to root just fine.

    I had a yubikey I would login with on 18.04, maybe that’s what’s wrong? I checked the pam.d files and they seem to have reverted back to their original state (I had to edit them to get the yubikey to work).

    I am stuck and could use some help, thanks in advance!

  • Whitehotburn
    Whitehotburn about 4 years
    I ended up messing with my pam.d files, and I think that did the trick. I edited out some lines I added to configure the yubikey. Once I got back in, I had to reinstall ubuntu-gnome-deskto (which was a PITA, I had a bunch of broken packages), but I did finally get it working.