34

I successfully installed drivers to run the Nvidia 750 Ti graphics card in my desktop. Ubuntu ran perfectly for a short time after that. Then, the update manager prompted me to install some updates. I did so and rebooted. After that, when I try to login the screen blinks and goes back to login. I have tried several other guides which solve similar problems but none of them have helped.

I am dual booting Windows 8 and Ubuntu 14.04.

  • Can you switch to a TTY (Ctrl+Alt+F1), login, rm .Xauthority, switch over to the GUI again (Alt+F7) and retry? – s3lph May 17 '15 at 18:13
  • @the_Seppi I have tried this already and it didn't solve the issue – Zachary Landry May 17 '15 at 18:38
  • If installed with .run files are causing problems, then why providing these files anyway? Purge any previously installed nvidia drivers and install it using apt-get as mentioned by @Pilot6 worked on mine. – MeadowMuffins Jun 5 '17 at 11:03

12 Answers 12

18

This happens when you install Nvidia drivers using a .run file, downloaded from Nvidia site. This a wrong way to install drivers. After each kernel update you will have to install them again using console, because GUI won't start. Now you can fix it by going to console by pressing Ctrl+Alt+F1. Then login there and run

sudo apt-get purge nvidia*
sudo apt-get install nvidia-331

Then reboot.

If this does not work, then you need to uninstall the driver. You can look HERE for instructions.

  • 1
    I tried what you said and it did not solve the problem. When the install was occurring, I got a message that said it was unable to delete some files. Also the resolution became very bad, the login box now takes up a large part of the screen. Do you have any suggestions on how to fix this? – Zachary Landry May 17 '15 at 18:28
  • 3
    The problem is that you did not uninstall those drivers. You need to do in from console by going to the directory where that .run file is and run it again with "--uninstall" option – Pilot6 May 17 '15 at 18:30
  • What command would I use to run it? I am an Ubuntu newbie – Zachary Landry May 17 '15 at 18:33
  • I think the fastest way for a newbie will be to reinstall the system from scratch and never install drivers this way. – Pilot6 May 17 '15 at 18:34
  • I ran the uninstall and I got the notification that no drivers were installed. If i cannot solve the problem, is there a quick guide to reinstall? – Zachary Landry May 17 '15 at 18:39
8

Sadly, my experience is that:

sudo apt-get purge nvidia*
sudo apt-get install nvidia-current

is not guaranteed to work.

Sadly it also is true that kernel updates and xorg or other graphics driver updates often break the proprietary driver installation.

I have come to use this scheme:
1. as updates are announced, check for the above type of packages.
2. if none are included in the update, then let them in, no need for more actions.
3. if there are "risky" updates, then:

Press CTRL-ALT-F1, login and then type

sudo -i
stop lightdm
init 3
cd /to/dir/with/NVIDIA.run-file/
bash NVIDIA-CURRENTLY-INSTALLED-VERSION.run --uninstall
apt-get update && apt-get upgrade

if there was a KERNEL update; enter reboot
and restart with the new kernel in recovery mode, then...

cd /to/dir/with/NVIDIA.run-file/
bash NVIDIA-NEW-or-PREVIOUS-INSTALLED-VERSION.run
reboot

I also recommend to update to kernel 3.16, as a means to bypass the numerous/imminent kernel 3.13 updates.
Follow the instructions for Trusty here:
https://wiki.ubuntu.com/Kernel/LTSEnablementStack

NOTE: Avoid later kernels for the time being, i.e. until there is similar support for them.

4

The cause is when you upgrade something related to .Xauthority with sudo, root will own this file and you cannot login as a user. Just press Ctrl + Alt + F2, login with your username and

sudo chown [your_username] /home/[your_username]/.Xauthority
  • 1
    This may be one cause, but it's far from the only possibility. My .Xauthority is fine but I can't so far fix the issue... – taxilian Feb 9 '17 at 20:37
3

Nvidia drivers install and register code with dkms. This is not part of the standard install for Ubuntu desktop but if dkms is not installed each kernel update will have the potential to break the Nvidia drivers again.

To keep this from happening, you can install "dkms" yourself:

sudo apt-get install dkms

After installing dkms, reinstall the Nvidia drivers using the run file again. They will be able to register the drivers for recompiling when new kernels are installed.

1

another temporary way to continue work is:

  1. in boot choose recovery mode, then

  2. on recovery menu choose Resume normal boot

after that you will be able login :)

  • I experienced a similar issue after downloading the Nvidia-410 drivers for Asus GeForce GTX 1080 cards on an Ubuntu 18.04.1 LTS build; after I installed the drivers, for whatever reason, I was unable to log-in until I restarted the system but instead of entering my password on the log-in prompt, I clicked on the Settings-wheel icon and selected 'Ubuntu on wayland' instead of 'Ubuntu'. Hope that helps! – alexanderjsingleton Nov 12 '18 at 16:04
0

I have an eMachines T5254 with an Nvidia GeForce 6100 graphics card. Every so often (likely when I get a new kernel) the computer will boot to a black screen with what should be the login screen. My working fix has been to

  1. At the black screen, press ctrl + alt + F1 (or whichever is not my current session) and use:

    sudo apt-get purge nvidia-*

  2. Reboot into safe mode (holding shift at the BIOS screen) select Advanced Options and then Recovery Mode. You may have to select an older kernel version.

  3. Select safe graphics mode. (For me, after selecting it kicks me back to the main Recovery Mode screen and I select Boot Normally. I feel this is a bug, but it loads in safe graphics mode at any rate).

  4. The gui should load now (not the fix, obviously). Go to the System Settings window. Click Software and Updates. At the end is Additional Drivers. When it finishes loading, it gives me four options. The first two are for Nvidia drivers ver 304, the third for ver 170, and the last is a generic driver. The only one that works is ver 170. Select it, wait for the update to download and restart.

I suppose this is possible through the command line, but I didn't find any guides online addressing this. Hopefully this is helpful to someone else out there.

0

I found the same thing to happen. The formula I used was to uninstall the NVIDIA drivers via this method : Hit Ctrl+Alt+F4 to login via tty4

sudo apt-get purge nvidia*
sudo apt-get install nvidia-331
sudo service lightdm stop
sudo apt-get install gdm

I also used

sudo dpkg -reconfigure gdm

The login screen looks different. But I was able to login without being locked out of the GUI method of logging in.

Not perfect but at least I was able to login again.

  • What a unnecessary, unuseful and nigling method. – Salih Karagoz Aug 8 '17 at 11:43
0

I ran into a similar problem having installed nvidia-304 driver, and in an attempt to get that working I made some changes which got my Ubuntu into an infinite login loop.

So I tried all the methods mentioned here, but nothing worked out. Hence, I started tracing all the changes made earlier. Finally the solution found was the changes made to "update-alternatives".

Hit: Ctrl+Alt+F1 and login to tty1

sudo update-alternatives --install /etc/ld.so.conf.d/i386-linux-gnu_GL.conf i386-linux-gnu_gl_conf /usr/lib/i386-linux-gnu/mesa/ld.so.conf 500

and

sudo update-alternatives --install /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf x86_64-linux-gnu_gl_conf /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf 500

Hope that helps.

0

I had a similar issue (apt-get upgrade and basically everything broke) during the last few days. Here are my learnings. I hope they may help someone out there.

I'm running Ubuntu 14.04 on several machines and my solution worked on all of them once I found it :P

First of all, updating graphics drivers and kernel at the same time may cause an issue if the graphics kernel modules are built for the running kernel, because the kernel will change after reboot.

After fiddling around for a few hours, this was my solution (on a desktop, only using the installed Nvidia graphics card, so no need for bumblebee or primus).

Symptom: every time I restarted lightdm (service lightdm restart) the driver would fallback to mesa, so not using the Nvidia driver I had installed/updated. The message in /var/log/Xorg.0.log was that it could not load nvidia_drv.so) to check:

update-alternatives --get-selections # lists all alternatives
update-alternatives --config x86_64-linux-gnu_gl_conf # available options and lets you choose "0" to automatically select the best driver
update-alternatives --config i386-linux-gnu_gl_conf # for multiarch or i386 machines

Example:

update-alternatives --config x86_64-linux-gnu_gl_conf
There are 3 choices for the alternative x86_64-linux-gnu_gl_conf (providing /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf).

  Selection    Path                                       Priority   Status
------------------------------------------------------------
* 0            /usr/lib/nvidia-340/ld.so.conf              8604      auto mode
  1            /usr/lib/nvidia-340-prime/ld.so.conf        8603      manual mode
  2            /usr/lib/nvidia-340/ld.so.conf              8604      manual mode
  3            /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf   500       manual mode

Result: even after explicitly setting it to "auto", once starting lightdm would reset it to mesa driver, which can be seen in /var/log/alternative.log.

The solution:

service lightdm stop
# remove all old stuff
apt-get remove --purge nvidia\*
apt-get remove --purge bumblebee
apt-get remove --purge primus primus-libs
apt-get autoremove --purge
# unload old drivers from kernel
rmmod nvidia
rmmod drm
# now everything is gone. Make sure you are running the latest kernel, then:
apt-get install nvidia-XXX # nvidia-367 for me, nvidia-current fits generally
update-alternatives --auto x86_64-linux-gnu_gl_conf
update-alternatives --auto i386-linux-gnu_gl_conf
service lightdm start

Et voila, /var/log/Xorg.0.log shows that it loads libglx and nvidia_drv from NVIDIA corporation. glxinfo verifies that.

0

My experience is this:

I found out the reason why I wasn't able to login after nvidia driver installation because my display driver is set to an NVIDIA driver obtained by Ubuntu. I guess some conflict occurs as the installer is unable to overwrite Ubuntu's configuration.

The solution is to set the display back to Noveau display driver, then proceed to the installation with the *.run file.

  • Using .run files can always lead to problems. It's better to use apt install to assure you install a supported version. – derHugo Nov 9 '17 at 18:08
0

I've just had the same problem after an update of the Nvidia driver... To solve the problem I have reboot using the recovery mode:

  1. When the GRUB menu appeared I've selected "Advanced Options"
  2. From the list I've selected the recovery mode option:

    Ubuntu GNU/Linux, with Linux 3.8.0-26-generic (recovery mode)
    
  3. I have selected the option:

    Drop to root shell prompt
    
  4. Then I did what @Pilot6 suggested: removed all nvidia drivers:

    apt-get purge nvidia*
    

    As long as you are now logged in as a root you don't need sudo

  5. Then I've reboot and returned the driver for the currently available hardware.

    sudo apt-get install nvidia-current
    

It works fine so far... I hope this helps you.

More info about the recovery mode you can find in this post: RecoveryMode

0

Press CTRL-ALT-F1 to the terminal

Uninstall any previous drivers:

sudo apt-get remove nvidia-*
sudo apt-get autoremove

Go back to the GUI by:

sudo service lightdm restart

protected by Community Oct 5 '18 at 10:26

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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