I was working on my Lenovo Idea Pad with Ubuntu when suddenly the screen froze, I could move the mouse and see the cursor moving, but clicking or pressing the keyboard keys had no effect, so I decided to reboot the computer holding the physical power button.
When the computer turned on again, I was presented with the login screen as usual, I choose my user and entered my password. The screen then became black and after a few seconds I was again in the same login screen. I tried several more times and the same happened. I tried entering a wrong password and the message of invalid password correctly appeared.
I searched in many sites and I found a bunch of people in my same situation, and every article or answer in Ask Ubuntu points to one of 4 solutions:
- problems with .Xauthority file
- problems with tmp folder
- problems with not enough disk space
- problems with gdm or lightdm
For number 1), I couldn't even try the proposed solutions because I don't have any file with that name. So I ignored that situation.
For number 2), I triple checked and I have the correct permissions for that folder, so that can't be the problem either.
For number 3), I checked several times and I have plenty of free space in my disk and partition (69% full). Still, I removed several videos using the console in order to free more space, just in case, but it didn't work either.
For number 4), I tried removing and reinstalling and reconfiguring both GDM3 (that was the package I was using) and LightDM, and nothing changed, I get the exact same problem with both.
One strange thing is, I have two users for this computer. My main user is the one having problems. But if I try to log in with the other user, it just works ok.
Any idea of what can I Do? I already checked this question Ubuntu gets stuck in a login loop and other similar to that one.
Update 1:
If someone finds himself in the same situation, I discovered that I can log in to the user without the problem via UI, then from there go to the power menu and choose "Switch user" (right near "log out", below the Suspend, Restart and Power Of options). After choosing "Switch user" I was able to login to my main user (the one with the loop problem) normally, via the UI.
Update 2: Solution
Using @user10489's method, I was able to find the problem: I put all my hidden files from the home folder into a "broken" folder and then I was able to login normally. So then I restored all the hidden files and tried moving them to the broken folder one by one, each time trying to login to see where it broke. It turned out that I had an extra line in my .profile
file that was miswritten and that was causing the login issue.