Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I've been running Ubuntu 12.04 since it's debut in 2012 without a single problem. Today I just ran sudo apt-key update && sudo apt-get update and then I rebooted my computer. After rebooting however, it first shows the Ubuntu bootscreen (with the Ubuntu logo and the dots below it) after which it booted to the command line. I could login and navigate around on the command line, but no GUI was loaded at all.

So I tried running sudo startx, but this gave a message saying (among others) the following:

NVIDIA: API mismatch: the NVIDIA kernel module has version 304.88, but this NVIDIA driver component has version 304.108. Please make sure that the kernel modle and all NVIDIA driver components have the same version.

I found this thread which suggested to do:

sudo service lightdm stop # to stop the xserver
sudo apt-get remove --purge nvidia* # to remove all driver elements
sudo apt-get update
sudo apt-get install nvidia-current
sudo reboot

After doing this, it now boots to the login screen where it seems that there are now two users named kramer65 on my computer. One of the two has the default (instead of my personal) background and says my password is incorrect. The other one seems to be my "real" account and when I type my password it seems to try to show the desktop. Instead however, it shows a black screen after which I think crashes, because it loads the login screen again.

So I guess the Nvidia driver is still not okay, or maybe there is something wrong with the duplicate accounts (both with a username kramer65 (but I guess it's the Nvidia driver).

Does anybody know what else I can do from here? All tips are welcome!

[EDIT] The strange thing is that I can actually login using the guest account, so I don't understand whats wrong with the specific kramer65 user login.

share|improve this question

marked as duplicate by Braiam, karel, Eric Carvalho, BuZZ-dEE, Eliah Kagan Jan 20 '14 at 12:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Ctrl+Alt+F1 change to vt 1 and login, then run shell> cat /etc/passwd to check all users. – sgx1 Dec 27 '13 at 12:08
@sgx1 - When I do that, I see one user displayed that is called kramer65 as follows kramer65:x:1000:1000:kramer65,,,:/home/kramer65:/bin/bash. I don't know what the three comma's mean, or if this is ok at all? If this is ok, would you have any other suggestions about the Nvidia driver? – kramer65 Dec 27 '13 at 12:14
dump all log files in /var/log/lightdm to – sgx1 Dec 27 '13 at 12:46
Try to install gdm once. I'm sure that lightdm will be your problem. – Saurav Kumar Dec 27 '13 at 13:15
up vote 2 down vote accepted

I don't know about the duplicated account, but running sudo startx as part of your driver diagnostic / repair process has likely left a root-owned .Xauthority file in your home directory. The X server tries to write to this file when lightdm passes control to the user session, and if it fails the session terminates and sends control back to lightdm, causing a 'login loop'

You can go into a Ctrl+Alt+Fn virtual terminal, log in as your regular user (the .Xauthority file is not involved in console logins), and check with

ls -l ~/.{ICE,X}authority

(this will also list the ownership/permissions on ~/.ICEauthority, which also sometimes gets messed up). If it is root-owned then either change its ownership back

sudo chown $USER:$USER ~/.Xauthority

or simply remove it (a fresh copy will be generated on the next successful GUI session startup)

rm -f ~/.Xauthority

If that works, and allows normal GUI login from either of the apparent duplicate accounts, we can then investigate further about those.

share|improve this answer
Awesome, that indeed lets me log in again (wich was 99% of my trouble)! If you would have any idea as to how I can fix the duplicate accounts your awesomeness would reach perfection.. :) – kramer65 Dec 27 '13 at 13:13
My guess is it's something messed up in the lightdm or greeter configuration - your cat of the passwd file suggests there really isn't a duplicate account (in fact it shouldn't be possible to have accounts with the same username) but you could double check with awk -F: '$3 > 500 {print}' /etc/passwd. You could also post your /etc/lightdm/lightdm.conf and /etc/lightdm/users.conf files. – steeldriver Dec 27 '13 at 13:49

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