I have noticed that whenever there is an update to kernel, my graphics degrade to the extent they are unusable. After some investigation, I realized that the culprit was linux-headers-xxx-generic package not being automatically installed. Is this expected? Is there a way to make it automatic?
For instance, I just installed updates using pkcon update command and the system notified me that a restart is required. After restarting, something was wrong with the graphics: only one of the two monitors were working and transparency effects were taking an extremely long time to load. Running kinfo command showed me the Graphics Processor was llvmpipe instead of my NVIDIA card. This exact same scenario had occurred a couple of times before so I knew exactly what need to be done. I just ran the command sudo apt install linux-headers-$(uname -r) and restarted the machine to get it back up and running smoothly.
The question I have is this: how can I automate the installation of linux-headers-$(uname -r) every time there’s an update to the kernel?
They should be installed, normally. This is a pure Ubuntu thing as well, nothing neon touches here.
Make sure you have linux-headers-generic-hwe-24.04 installed. This meta-package depends on the current header package for each new kernel build. It is included in the install, but worth double checking. This is what would pull in the matching headers for the kernel. I have them on both my systems here.
I have installed it now. I am assuming that when Neon switches to 26.04 (?) the appropriate package will replace this one. In any case, 26.04 is so far way
It will depend on the linux-headers package for every new kernel build, so it will pull a new one each time there is a kernel update/security patch. This should hopefully solve the issue.