14

I have an older Nvidia video card and my PC crashes when installing the driver for the video card in Ubuntu 16.04. When I get to the login screen but no further: after entering my password, the system went into a loop and returned always back to the login screen [with funny stripes present].

How do I fix this problem?

jokerdino
  • 41,320
rob grune
  • 1,068

3 Answers3

12

Edited out of the question posted by Rob grune:

To recover, follow these steps:

Ctrl+Alt+F1 [to exit and get into the TTY mode]

sudo apt-get remove --purge nvidia*
sudo apt-get install ubuntu-desktop
sudo apt-get autoremove
sudo rm /etc/X11/xorg.conf
echo "nouveau" | sudo tee -a /etc/modules
sudo reboot

[after reboot, you should be back to operational with the nouveau driver, and can login]

sudo add-apt-repository --remove ppa:graphics-drivers/ppa
sudo apt-get autoremove
sudo apt-get autoclean
  • I'm not convinced that sudo apt-get install ubuntu-desktop is necessary as I didn't nor did I sudo rm /etc/X11/xorg.conf as the file was not in existence in the installation I was working on. There's also no need to sudo add-apt-repository --remove ppa:graphics-drivers/ppa if you aren't using that ppa. All that said I can confirm the rest of the process works. As this system does not require high performance graphics, I'll be sticking with the nouveau driver, however I would imagine that if desired one could try installing the latest nvidia-current package – Elder Geek Nov 13 '16 at 00:11
  • Correction: the 'autoremove' command lines should both be using apt-get, not apt. – Leland Woodbury Dec 04 '16 at 17:22
  • This worked for me. (My assessment agrees with @ElderGeek's.) Thanks! – Leland Woodbury Dec 04 '16 at 17:28
  • @LelandWoodbury You are correct regarding apt autoremove (fixex) Keep in mind that once your reputation is high enough you'll be able to make these corrections yourself. – Elder Geek Dec 06 '16 at 01:40
  • I know this question is about 16.04. Just as an update these steps didn't work for me on Ubuntu 17.10 – byf-ferdy Nov 24 '17 at 12:42
  • How? Even in tty mode I am stuck in a login loop. – Chris Mayer Feb 25 '19 at 03:18
  • @ChrisMayer, if the lightdm loaded, you could try Ctrl-Alt-F12 to go to your console (without the graphics at all) – Alexis Wilke Sep 26 '19 at 03:05
3

Ubuntu has this guide on their own wiki - but that one was last updated 2013-02-06, so I wouldn't put too much trust/hope/faith/work/time in it.

Here is a recipe which removes all old video drivers, and reinstalls nouveau:

sudo nvidia-settings --uninstall
sudo apt-get remove --purge nvidia*
sudo apt-get remove --purge xserver-xorg-video-nouveau xserver-xorg-video-nv
sudo apt-get install nvidia-common
sudo apt-get install xserver-xorg-video-nouveau
sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
sudo dpkg-reconfigure xserver-xorg
jokerdino
  • 41,320
3

I was having the same issue with Dell Vostro 1500 (GeForce 8400M GS) after updating to the recent Ubuntu 16.04.2 and using the nvidia-340 driver. It took me almost a day to resolve it. Here in shortcut what you can try:

First of all press CTRL+ALT+F1 to get to the text console. Then log in.

Do cat /var/log/gpu-manager.log. If you see something like this:

Looking for nvidia modules in /lib/modules/4.4.0-72-generic/updates/dkms
Found nvidia module: nvidia_340_uvm.ko
Is nvidia loaded? yes
Was nvidia unloaded? no
Is nvidia blacklisted? yes
...

Then the reason for the login loop is most likely that the nvidia kernel DRI module is blacklisted. This might be because bumblebee was previously installed with an older version of the nvidia driver (in my case nvidia-304) and now is no longer used. If not purge deleted it leaves config files in /etc, among them also module blacklists. The blacklisted module causes the X server to fail to initialize after logging in, which results in the login loop.

Check whether bumblebee is installed:

apt list --installed | grep bumble

If not (no output of the above command) check if /etc/modprobe.d/bumblebee.conf exists:

ls -l /etc/modprobe.d/bumblebee.conf

If it exists just delete it:

sudo rm /etc/modprobe.d/bumblebee.conf

And now try again either by rebooting or by running:

sudo service lightdm restart

You can also see the detailed problem analysis in my other post.

Brain
  • 190
  • thank you! This was the 2nd time when I faced with this issue and I was close to remove the nvidia driver when I found your comment. It fixed my issue. This should be the accepted answer! – Zoltán Süle Aug 25 '18 at 11:01