This question already has an answer here:
- Ubuntu gets stuck in a login loop 45 answers
I have installed Ubuntu 17.04. For a while it worked great. Then I have installed a couple of packages which I don't remember. When I rebooted my laptop, I couldn't login from the default login desktop environment. Every time I try to login, it accepts the password, but loopsback to login screen again. But from the Unity8 desktop environment I can login without a problem. its not a startx, lightdm,owner problem etc..