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.