4

My computer was running fine until yesterday night, but today it is stuck in a login loop.

I tried going into recovery mode from grub and reconfiguring dpkg packages, but it didn't work, tried switching from lightdm to gdm3 but this just gives me a black screen upon login, then tried reconfiguring lightdm, uninstalling and reinstalling lightdm and all of this did not work, I'm still stuck on login loop. I've tried various methods found by googling, and I also wondered if my nvidia drivers were messing something up (even though that seems strange, since I've been using the computer with those drivers installed for quite some time) so I uninstalled the current nvidia drivers and installed nvidia-current drivers (304 I think), but I'm still stuck.

What else can I try? I'm starting to think about doing a clean install, but I would prefer fixing the problem rather than having to lose everything and start with a clean slate.

Thanks for any suggestions!

EDIT: Couldn't find any error messages in either /var/log/Xorg.0.log nor /var/log/Xorg.0.log.old

EDIT2: So, after a bit of looking around, I saw that there was some problem with reading .Xauthority, so I just created a backup and a new .Xauthority file and that solved it, but still after a few seconds being logged in I get a black screen and get sent back to the login screen. Looking at the lightdm logs I find a critical error, "session_get_login1_session_id: assertion 'session != NULL' failed". Any idea on how to fix this

13
  • I would suggest looking at the boot output to maybe get an idea of where its hanging up. If its easy for you to reinstall that might be the best option though. Jul 29, 2016 at 14:50
  • Looks like something is crashing X when you log in. Are you able to pull up any logs?
    – bwDraco
    Jul 29, 2016 at 14:50
  • Where would I look for these logs? I thought about pressing F2 during the splash screen, but the hangup is on the login page, not on the OS loading Jul 29, 2016 at 14:58
  • Try opening /var/log/Xorg.0.log and /var/log/Xorg.0.log.old (as root if needed). See if there's anything toward the end of the log (especially the old one) that indicates an error of some sort, and edit the relevant information into your question.
    – bwDraco
    Jul 29, 2016 at 15:22
  • 1
    So, after a bit of looking around, I saw that there was some problem with reading .Xauthority, so I just created a backup and a new .Xauthority file and that solved it, but still after a few seconds being logged in I get a black screen and get sent back to the login screen. Looking at the lightdm logs I find a critical error, "session_get_login1_session_id: assertion 'session != NULL' failed". Any idea on how to fix this Jul 30, 2016 at 12:35

7 Answers 7

3

None of the solutions I found on the web worked. I managed to use my computer by doing this:

  • CTRL+F1 to log in textual mode
  • Remove ubuntu-desktop and other graphical libraries:

    sudo apt-get purge ubuntu-desktop
    sudo apt-get purge xorg*
    sudo apt-get purge x11*
    
  • Install xubuntu

    sudo apt-get install xubuntu-desktop
    

Then, I rebooted and now I am happily writing to you from my xubuntu

2
  • 1
    Funny thing ... So I tried this... and it did not work :( Mar 21, 2018 at 5:56
  • I followed this too and it worked great for xubuntu, but still unable to get ubuntu working. If anyone has any ideas to get back to ubuntu I would be all ears
    – KGee
    Jan 24, 2019 at 12:54
2

My problem was simple. I had made a change to my /etc/profile that wacked the PATH.
To check and fix: boot up

ctrl-alt F1 to get to a command prompt

sudo su to become root

/usr/bin/vi /etc/profile

check for a problem or remove any change you made

wq to save

sudo reboot

this worked for me

1

So, after trying to follow many troubleshooting tips found on the net that helped people with a similar problem to mine I couldn't fix my PC. I solved my problem by doing a clean install, maybe it could have worked also with a dual boot install and maybe that way I would have been able to get back some of the files I had, but I'm not entirely sure about this.

1
  • 1
    This is bad for Ubuntu that one needs to reinstall it to make it work again.
    – pbies
    Aug 2, 2016 at 14:47
1

So, I had the same issue which for me occurred after some upgrade and/or dist-upgrade. This has happened a few times before, but this last time it happened I noticed the resolution of the login screen was much lower than it was supposed to be. I figured this was caused by the NVIDIA driver not loading or something of that sort.

What I did was to stop the lightdm service and reinstall the NVIDIA driver and then started the lightdm service again. That fixed the issue for me.

Other times it happened I have resorted to reinstalling Ubuntu.

Anyway, if it happens again in the future, try that. Might work for you as well.

1

I faced the same issue and solved it.

These are the methods I tried but NOT positive results.

 1.Playing around with .Xauthority file.
 2.Installing/Reinstalling oflightdm
 3.Nividia drivers

First, I did'nt upgrade my OS. I did'nt install any application. Later After careful analysis , found that i ran a shell script with sudo command but the shell script already has a sudo in it.

Eg : if name of the shell script is ChangePermission.sh ( this script helps to change folder access permission )

command to change folder access permission

sudo chown -R $USER: $HOME

WARNING : DO NOT RUN THIS SCRIPT WITHOUT PRIOR KNOWLEDGE !

i ran the above script with sudo in terminal and caught in login loop problem.

   abdullah@Storm:~$ sudo sh ChangePermission.sh 

here, I executing the script with sudo but the script also has another sudo in it.which caused the login issues (for me)

Thus i removed login loop issue by running the same script without sudo and resolved the issue.

  abdullah@Storm:~$ sh ChangePermission.sh 
0

use this to install cinammon desktop:

sudo add-apt-repository ppa:embrosyn/cinnamon
sudo apt update 
sudo apt install cinnamon

for gnome desktop:

sudo apt-get install ubuntu-gnome-desktop

for

0

I solved this problem on Ubuntu 16.04 by rolling back to previous kernel.

Hold shift key while booting, and booted to 4.10.0-42 and removed 4.13.--

I used the following 2 commands:

$sudo apt-get purge linux-image-4.13.0-26-generic

$sudo apt-get purge linux-headers-4.13.0-26-generic

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