dkms: WARNING: Linux headers are missing, which may explain the above failures...

Dubard

Active Member
Oct 5, 2016
61
2
28
47
Switzerland
Hi everybody,

I don't always think about installing the Headers corresponding to the kernel in place before doing "apt-get dist-upgrade" and when I forget to do it, I always have this error that appears:

Code:
...
...
...
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.15.18-2-pve /boot/vmlinuz-4.15.18-2-pve
run-parts: executing /etc/kernel/postinst.d/dkms 4.15.18-2-pve /boot/vmlinuz-4.15.18-2-pve
dkms: WARNING: Linux headers are missing, which may explain the above failures.
     please install the linux-headers-4.15.18-2-pve package to fix this.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.15.18-2-pve /boot/vmlinuz-4.15.18-2-pve
...
...
...

I have two questions:

1) How could I avoid this mistake every time ?

2) If I forgot to install the Headers corresponding to the kernel in place and I have the error, is it possible to run a command again so that the installation concerning DKMS ends properly ?

Many thanks
 
Install the 'pve-headers' package (virtual package which will install the headers for the current default kernel).
You can reinstall the package that triggers it to run it again.
 
Install the 'pve-headers' package (virtual package which will install the headers for the current default kernel).
You can reinstall the package that triggers it to run it again.

Thank Mira for your reply,

But... I know I have to install the headers corresponding to the kernel that will be updated....here is the command I execute (example for kernel 4.15.18-10-pve) when I don't forget to do it before the "apt-get dist-upgrade" command:
Code:
...
...
apt-get install pve-headers-4.15.18-10-pve
...
...

My question is mostly...if I forgot to execute the above command before doing "apt-get dist-upgrade"...how can I correct the error because when there is "apt-get dist-upgrade" running...I don't see which module needs the DKMS ?

Many thanks
 
Last edited:
Re,

Could I re-run the commands :

Code:
root@myserver:~# apt-get install pve-headers-4.15.18-10-pve

root@myserver:~# /etc/kernel/postinst.d/dkms 4.15.18-10-pve /boot/vmlinuz-4.15.18-10-pve

...after "apt-get dist-upgrade" command if I forget to install the kernel headers before ?

Thanks
 
You should install pve-headers:

> apt install pve-headers
 
Thanks Tom for your reply,

So if I understood correctly, by installing pve-headers on my servers...during my next update, by typing ONLY "apt-get dist-upgrade"...if the kernel needs to be updated, I will have no more errors concerning "/etc/kernel/postinst.d/dkms" script.

Many thanks
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!