Those of you who like their systems staying stable and repeatable who are reading this right now are still probably using Ubuntu 12.04 even though 14.04 has been out for over half a year now. Recently, you’ve all probably seen the following when logging into a TTY or when updating system packages:
Your current Hardware Enablement Stack (HWE) is going out of support on
07/08/2014. After this date security updates for critical parts (kernel and
graphics stack) of your system will no longer be available.
For more information, please see: http://wiki.ubuntu.com/1204_HWE_EOL
I decided that this would be a reasonable thing to do, and since it was through the system update manager, it was less likely that it breaks anything critical. If you’re not familiar with the “Hardware Enablement Stack” it’s (as described above) what Canonical has been using to refer to the Linux Kernel recently.
The most likely thing to break when you upgrade a kernel are anything that requires building a kernel module. Sure enough, after doing this, my graphics stack no longer worked. I had been using the NVidia CUDA 6.5 release and the NVidia 340 series driver from the official NVidia debian repositories so it’s not too surprising that this didn’t work smoothly.
Uninstall / purging and reinstalling the driver didn’t work, so I quickly searched for similar issues online and found this useless thread. People offer a bunch of unsatisfactory solutions, most of which don’t apply because I was using the CUDA drivers. After digging through the logs, it became apparent that the NVidia installer couldn’t build the kernel module because the “kernel source” couldn’t be found:
Installing the NVIDIA display driver...
The driver installation is unable to locate the kernel source. Please make sure
that the kernel source packages are installed and set up correctly. If you know
that the kernel source packages are installed and set up correctly, you may
pass the location of the kernel source with the '--kernel-source-path' flag.
The core problem is that the HWE update doesn’t install the headers for the new kernel, and these headers are necessary for the NVidia driver to build its kernel module. To fix it, I just needed to install the headers corresponding to this new kernel and then reinstall the NVidia driver:
sudo apt-get install linux-headers-generic-lts-trusty
I’m really surprised the HWE update doesn’t do this automatically, but I guess this update path is a new “feature.”