Ubuntu 20.04 LTS stuck login loop: General Solution

Ubuntu 20.04 LTS Focal Fossa is the latest Linux distro from Ubuntu developers with Long term support for Server and Desktop. Recently, I have started using it but later, after a few updates and upgrade, I got a problem, it stuck on login screen in the loop. Even I was entering the right password but it didn’t let me log in my Desktop. Thus, again and again, I end up with Ubuntu 20.04 Login screen which was frustrated.

If you are facing the same problem, recently and want to break the loop, then here is the common thing which I have done and want to share with you the same.

On Login screen of Ubuntu 20.04 where I have been stuck for some time, I simply switch to get command mode. For that press, CTRL+ALT+F3, this will drop you on the command line interface with login option.

However, to exit Command line, you can use keyboard shortcut that is CTRL+ALT+F2,  to get back the Graphical User Interface.

Enter your Ubuntu user name along with the password which you are using so far. Now, simply first update and then run upgrade command:

sudo apt update
sudo apt upgrade

Finally, reboot the system with:


Now, this time when you try to login Ubuntu 20.04, you will be able to, successfully. I had tried it on Focal fossa but surely you can do it with previous Ubtunu 19.10 or 18.04 LTS if you have similar kind of problem there.

Nevertheless, if you have tried out this method and didn’t work, then eventually you have hit and tried some other solutions. Thus, please let us know which one worked successfully for you in the comment section, it will help others tremendously… Thanks.


30 thoughts on “Ubuntu 20.04 LTS stuck login loop: General Solution”

  1. I had the same problem, but in my case, it was simply because the user files were not owned by the user (confusion between 2 previously existing users).

    ctrl + alt + F2 to enter into the terminal
    sudo chown -R [user]:[user] /home/[user]

    • This worked for me after creating the home directory.
      sudo mkdir /home/[user]
      sudo chown -R [user]:[user] /home/[user]
      Rebooted and login worked.

  2. My solution was similar to Pierre’s: the user files had been renamed erroneously in a mount-process by Windows in a dual boot system. Renaming them worked for me, thanks

  3. I just had a similar issue, with a clean install except I also couldn’t log in via the terminal.

    Turns out when I set up the password during installation, it was assuming a US keyboard, even though I selected UK. The password I thought I typed has a ” character but it was stored with a @ (these characters are swapped between UK and US keyboards)

    Once installed, it was set up for UK keyboard, so although I was typing the same keys, it was using the wrong characters! I could log in by typing a @ instead of the “

  4. Chrome-remote-desktop worked well for me also. Could you recommend any remote desktop solution instead?

  5. @Rheinhold: What files did you rename? I’m using a dual boot Windows/Linux setup as well. The upgrade from 18.04 to 20.04 seemed to go well at first, but after the next boot I’m now stuck in the login loop. None of the other suggestions have worked for me so far…

  6. I ve tried ctrl+alt+f3 and it just says wrong login. I m sure of the passworf because I’ve used it to install some updates right after installing ubuntu 20.04. 01 it s the first time I login after installation. Any idea of what’s going on?

  7. when i run sudo apt upgrade i got an error : Not enough space in /var/cache/apt/archives/
    i then run:
    sudo apt-get autoremove
    sudo apt-get autoclean
    and rebooted. worked fine, but i still get wornings about not having much diskspace left, and i assume that causes all the problems. >>lack of diskspace<<

    • Thanks Akni. I tried just about everything and then saw your comment and thought why not. And it has worked. I am finally able to login. Thank you.

  8. Thanks a lot! This resolved my issue! Why didn’t I think of such a simple answer, I had just upgraded to 20.04 so the obvious way to resolve would be to just update.
    This saved my day! Thanks again! 🙂

  9. My loop hell go away after:

    ls -lah | grep -i Xauthority

    sudo chown username:username .Xauthority

    replace username by your login name

  10. I’ve installed java yesterday night and in morning my ubuntu 20.04 LTS got in login loop. So this method helps me to login. Thanks mate.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.