Every few weeks/months the kernel on my Ubuntu 16.04.3 (x86_64) installation is automatically updated. That's fine, except that the corresponding kernel headers are not automatically installed at the same time and so the VirtualBox kernel modules are not rebuilt automatically. I have to manually do:
sudo apt-get install linux-headers-`uname -r`
in order to trigger the rebuild. (I got that command from the answer to: VirtualBox '/etc/init.d/vboxdrv setup' issue)
How can I arrange for the linux headers to be automatically updated as well? Or, alternatively, how can I ensure that the VirtualBox modules are automatically rebuilt when the kernel is upgraded?
I have the linux-headers-generic package installed as suggested in the answer to How to get Software Update to automatically grab kernel source along with kernel update?:
$ sudo apt-get install linux-headers-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-headers-generic is already the newest version (4.4.0.96.101).
linux-headers-generic set to manually installed.
Edited to add: The output of uname -a is
Linux riemann 4.10.0-35-generic #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
uname -a
to your question. – Pilot6 Sep 22 '17 at 20:52