Headers error when updating

Hi, I just updated my promox host after quite some time of it running stable and me traveling (so better not touch a running system). During update, I saw the following error:

Code:
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve
run-parts: executing /etc/kernel/postinst.d/dkms 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve
dkms: running auto installation service for kernel 5.15.74-1-pve:Error! Your kernel headers for kernel 5.15.74-1-pve cannot be found.
Please install the linux-headers-5.15.74-1-pve package,
or use the --kernelsourcedir option to tell DKMS where it's located
.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve
update-initramfs: Generating /boot/initrd.img-5.15.74-1-pve

Kernel modules where thereafter only compiled for an older kernel:

Code:
Setting up linux-headers-5.10.0-19-amd64 (5.10.149-2) ...
/etc/kernel/header_postinst.d/dkms:
dkms: running auto installation service for kernel 5.10.0-19-amd64:
Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...(bad exit status: 2)
make -j64 KERNELRELEASE=5.10.0-19-amd64 all KPVER=5.10.0-19-amd64...
cleaning build area...(bad exit status: 2)

DKMS: build completed.

mst_pci.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.10.0-19-amd64/updates/dkms/

mst_pciconf.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.10.0-19-amd64/updates/dkms/

depmod...

DKMS: install completed.

After seeing this, I did install the meta package pve-headers. DKMS didn't run again. Do I need to do anything else in oder to have kernel modules compiled for the new kernel?

Thanks!
 
Hi, I just updated my promox host after quite some time of it running stable and me traveling (so better not touch a running system). During update, I saw the following error:

Code:
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve
run-parts: executing /etc/kernel/postinst.d/dkms 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve
dkms: running auto installation service for kernel 5.15.74-1-pve:Error! Your kernel headers for kernel 5.15.74-1-pve cannot be found.
Please install the linux-headers-5.15.74-1-pve package,
or use the --kernelsourcedir option to tell DKMS where it's located
.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve
update-initramfs: Generating /boot/initrd.img-5.15.74-1-pve

Kernel modules where thereafter only compiled for an older kernel:

Code:
Setting up linux-headers-5.10.0-19-amd64 (5.10.149-2) ...
/etc/kernel/header_postinst.d/dkms:
dkms: running auto installation service for kernel 5.10.0-19-amd64:
Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...(bad exit status: 2)
make -j64 KERNELRELEASE=5.10.0-19-amd64 all KPVER=5.10.0-19-amd64...
cleaning build area...(bad exit status: 2)

DKMS: build completed.

mst_pci.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.10.0-19-amd64/updates/dkms/

mst_pciconf.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.10.0-19-amd64/updates/dkms/

depmod...

DKMS: install completed.

After seeing this, I did install the meta package pve-headers. DKMS didn't run again. Do I need to do anything else in oder to have kernel modules compiled for the new kernel?

Thanks!
Check whether the respective kernel modules are loaded respectively they can be loaded by modprobe. If not reinstall the kernel (maybe `apt -f install` is sufficient).
 
the PVE headers are actually in a differently named package: pve-headers (or pve-headers-X.Y , if you run a non-default kernel series). the linux-image-* and linux-headers-* packages should not be installed on PVE systems, as they might cause issues.
 
Thanks, so I have the pve kernels installed by default. Not sure where the old linux 5.10.0 kernel comes from. It's never booted.

As mentioned, after the error occured I did install pve-headers. Should I now
  • apt -f install pve-kernel-5.15.74-1-pve?
  • apt -f install <some meta package for pve kernels>?
  • deinstall some package to deinstall legacy kernels?
Not getting any errors when I'm trying to load the module. But maybe the system is loading an old rather than the updated version?

Code:
# modprobe -v -n mst_pci
insmod /lib/modules/5.15.39-1-pve/updates/dkms/mst_pci.ko
# modprobe -v -n mst_pciconf
insmod /lib/modules/5.15.39-1-pve/updates/dkms/mst_pciconf.ko
 
you should probably remove linux-image-* and linux-headers-* if they are still installed. other than that, if the module is built for the kernel (version) you want to use it with, everything should be okay. dkms status gives you a clear overview, and you can manually use 'dkms' to build and install (or rebuild and re-install, or remove/uninstall ;)) DKMS-managed kernel modules. re-installing the kernel package will also trigger a rebuild in any case, and also all the rest of the machinery that runs on kernel installs/upgrades (bootloader integration, initrd regeneration, ..)
 
TLDR of the below: Manual install of the mellanox driver for the pve kernel worked. Not sure I can remove the standard linux headers, though, as this will also remove other packages which may be required for DKMS?

Long version:

It seems what has happened is that I needed updated mellanox drivers. Upon installing them, their script ignored the fact/didn't recognize that headers (from pve) were already installed. So it tested and then installed "linux-headers" and "linux-headers-generic" (as well as "gcc", "make", and "dkms").

Code:
apt list --installed | grep headers

shows

Code:
linux-headers-5.10.0-19-amd64/stable-security,now 5.10.149-2 amd64 [installed,automatic]
linux-headers-5.10.0-19-common/stable-security,now 5.10.149-2 all [installed,automatic]
linux-headers-amd64/stable-security,now 5.10.149-2 amd64 [installed,upgradable to: 5.10.158-2]
pve-headers-5.15.39-1-pve/stable,now 5.15.39-1 amd64 [installed]
pve-headers-5.15.74-1-pve/stable,now 5.15.74-1 amd64 [installed,automatic]
pve-headers-5.15/stable,now 7.2-14 all [installed,automatic]
pve-headers/stable,now 7.3-1 all [installed]

This means that if I remove linux-headers-amd64, apt will also remove linux-compiler-gcc-10-x86, linux-headers-5.10.0-19-amd64, linux-headers-5.10.0-19-common linux-kbuild-5.10:

Code:
# apt purge linux-headers-amd64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-compiler-gcc-10-x86 linux-headers-5.10.0-19-amd64
  linux-headers-5.10.0-19-common linux-kbuild-5.10
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  linux-headers-amd64*
0 upgraded, 0 newly installed, 1 to remove and 16 not upgraded.
After this operation, 10.2 kB disk space will be freed.

Not sure I want this, as it may break dkms' ability to compile the mellanox driver for kernels going forward...?

The other thing is:

Code:
# uname -r
5.15.39-1-pve
# dkms status
kernel-mft-dkms, 4.18.0, 5.10.0-19-amd64, x86_64: installed
kernel-mft-dkms, 4.18.0, 5.15.39-1-pve, amd64: installed

So I built the mellanox drivers for the current kernel 5.15.74-1:

Code:
# dkms install kernel-mft-dkms/4.18.0 -k 5.15.74-1-pve

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...(bad exit status: 2)
make -j64 KERNELRELEASE=5.15.74-1-pve all KPVER=5.15.74-1-pve...
cleaning build area...(bad exit status: 2)

DKMS: build completed.

mst_pci.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.15.74-1-pve/updates/dkms/

mst_pciconf.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.15.74-1-pve/updates/dkms/

depmod...

DKMS: install completed.

I hope this is ok now, even though it's not clear to me why the module sometimes shows amd64 and sometimes x86_64 as platform...

Code:
# dkms status
kernel-mft-dkms, 4.18.0, 5.10.0-19-amd64, x86_64: installed
kernel-mft-dkms, 4.18.0, 5.15.39-1-pve, amd64: installed
kernel-mft-dkms, 4.18.0, 5.15.74-1-pve, x86_64: installed

... and the machine will reboot ok, if I dare to do it now.

(Yes, I have a backup. But I prefer not having to use it! ;))
 
Not sure I want this, as it may break dkms' ability to compile the mellanox driver for kernels going forward...?

that looks safe, the listed packages are all just relevant for Debian kernels, not PVE ones..
 

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!