How to resolve Login Loop in Ubuntu ?

Jeyam Thillai
Nov 5 · 2 min read

Are you again and again in to login screen ? yes ! you are looped - In other words your system lost PATH so its redirecting you again and again in to the login screen.

Press CTRL + ALT + F1 which open’s shell for you

login with your system name and password

Try some basic commands like cd ,ls ect .. to ensure your system lost path

Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found

are you getting this ? Yes ! you have lost your system path

Type ‘echo $PATH’ in your shell to check your current Path

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

If your shell is not returning something like this

type below in the shell and press enter

export PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:

/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"

and now ALT + F7 and try to login

if still not login again login in to shell and check ./profile and ./bashrc file whether you have added any code while trying to install something if there is any remove it.

and also try this in your shell

mv .Xauthority .Xauthoritybackup

And sudo service restart your lightdm

Hope this collective solution will work’s fine

Happy Linux :-)

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade