Nvidia drivers on Ubuntu 14.04 kernel 3.19

Looks like Nvidia will keep bothering me as long as I use linux…
After installing nvidia drivers on 14.04 with kernel 3.19, the computer would not boot!

The problem is, xserver-xorg-lts-vivid and the solution is replace it with xserver-xorg-lts-trusty.
Boot in recovery, enable networking, drop onto shell, and enter the following lines to magically fix the issue

sudo apt-get update
sudo apt-get remove --purge nvidia-* xserver* libcheese7
sudo apt-get install xserver-xorg-lts-trusty
sudo apt-get install nvidia-346 nvidia-settings nvidia-prime ubuntu-desktop
sudo reboot 

This is tested on Nvidia GTX650

Nvidia drivers on Ubuntu 12.04

Nvidia drivers don’t readily work with ubuntu 12.04 on kernel version 13.03. If they do, multiple monitors stop working. This can be fixed by using xserver from saucy. Following steps would fix the problems in most cases.

sudo apt-get update
sudo apt-get remove --purge nvidia-* xserver*
sudo apt-get install xserver-xorg-lts-saucy
sudo apt-get install nvidia-331 nvidia-settings nvidia-prime ubuntu-desktop
sudo reboot 

This is tested on Thinkpad W540 (Nvidia Quadro K2100M)