Ubuntu – update Linux Headers when Kernel is updated


Any time Ubuntu wants to upgrade my kernel, it doesn't seem to upgrade the headers at the same time. This results in certain drivers not being rebuilt such as wireless and virtualbox drivers. I always have to manually install the headers after the update and then rebuild the virtualbox drivers

sudo apt-get install linux-headers-3.5.0-31-generic 
sudo /etc/init.d/vboxdrv setup

Is there a way to have the headers update at the same time? It's very frustrating at times cause if I do it at home, I only use wireless and after the update I can't update the headers unless I pull out an ethernet cable to plug in.

Best Answer

if you install specific version of kernel header, then they will not be upgraded. You have to install header-generic

sudo apt-get install linux-headers-generic

The -generic header package will update headers every time linux-image is updated.