Nvidia driver on Ubuntu 13.10

I made the mistake to try to switch from the Nvidia driver to use the hybrid Bumblebee driver on Ubuntu 13.10 for my Lenovo T420s laptop with NVIDIA GPU NVS 4200M (GF119). I ended up with a situation where I couldn’t get the Nvidia driver working again. I had to switch back to the default Nouveau driver. I don’t remember the exact steps, but I did roughly the following:

sudo apt-get remove bumblebee nvidia-319-updates
sudo apt-get install xserver-xorg-video-nouveau
sudo dpkg-reconfigure xserver-xorg

This got me back to the Nouveau driver, but that didn’t support my external display on the Displayport, so I was eager to get the Nvidia driver working again.

sudo apt-get remove xserver-xorg-video-nouveau
sudo apt-get install nvidia-319
sudo dpkg-reconfigure xserver-xorg

But when I reboot it looked like the X server would start up, but it crashed and dropped to a shell before the login screen. Checking the logs I found that there was an issue loading the Nvidia kernel module. To make a long story short, I did the following the get the Nvidia driver working again. I’m not sure which step that actually made the difference.

sudo vi /etc/modprobe.d/blacklist.conf


#Problem getting Nvidia to work
blacklist nouveau

I found some remnants of Bumblebee, which possible caused some issues with kernel modules, since it blacklists Nvidia:

less /etc/modprobe.d/bumblebee.conf

So to get rid of it I did the following:
sudo apt-get purge bumblebee
Purge will delete configuration files, including bumblebee.conf.

I got to the login screen after a reboot, which was a step forward. However, trying to login failed and I got back to the login screen. Turns out that .Xauthority had incorrect permissions. Fix the ownership or just delete it.

sudo rm .Xauthority

Finally running with Nvidia driver again!