I have installed Ubuntu 18.04.2 (LTS). It was working smoothly for some days. But now I can't login. When I try to get into the desktop by entering the valid password and hit enter button, after 5-6 seconds the screen splashes and the login screen appears again. I can login into my account with the shell by pressing Ctrl+Alt+F2 and get back into the GUI login screen by holding Alt+Left until that appears. I have tried all solutions in the question Ubuntu gets stuck in a login loop. But all failed to login into my account. One answer suggested me to create new user with permission to use the sudo command. With that new account I can login. But when I try to login with the previous account the login loop continues. I need to access that account. An answer suggested me to check the permission of .Xauthority, but it doesn't exists. I have also tried to get into the GUI by executing startx command in the shell. This works and appears a GUI on the new account but not on the previous account. Unfortunately I don't get an have an internet connection on Ubuntu. So I can't use apt or apt-get command. But I have a Windows PC with administration rights and internet connection.


Switch the login display manager from gdm3 to lightdm. LightDM is a more lightweight login display manager than gdm3. Download lightdm, change directories using cd to the directory containing lightdm_1.26.0-0ubuntu1_amd64.deb file that you downloaded, and run the following commands:

sudo apt install ./lightdm_1.26.0-0ubuntu1_amd64.deb     
sudo dpkg-reconfigure lightdm 
sudo reboot  

sudo dpkg-reconfigure lightdm will open up a new window allowing you to select lightdm as the default login display manager. Use the arrow keys to select lightdm and press the Tab key to put the focus on <OK> and press Enter. Then reboot by running this command: sudo reboot

If that doesn't work, try booting from Xorg instead of Wayland. Edit /etc/gdm3/custom.conf with sudo nano /etc/gdm3/custom.conf, uncomment #WaylandEnable=false so it is WaylandEnable=falseand runsudo dpkg-reconfigure gdm3 # select lightdm

You might need to delete .Xauthority (which is located in /home/your-username/.Xauthority) if the login loop persists after trying these suggestions. It will be created automatically the next time you reboot.



18.04.03 LTS

Did not work

  • Login to terminal (CTL+ALT+F4) and reset password.
  • Login to terminal, create a new user and try to login with the new user
  • Create empty ~/.bashrc and ~/.profile


sudo apt update
sudo apt install --reinstall ubuntu-desktop
sudo apt upgrade -y

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.