Setting up linux-image-4.8.0-1-686-pae (4.8.5-1) ... I: /vmlinuz.old is now a symlink to boot/vmlinuz-4.7.0-1-686-pae I: /initrd.img.old is now a symlink to boot/initrd.img-4.7.0-1-686-pae I: /vmlinuz is now a symlink to boot/vmlinuz-4.8.0-1-686-pae I: /initrd.img is now a symlink to boot/initrd.img-4.8.0-1-686-pae /etc/kernel/postinst.d/dkms: Error! Your kernel headers for kernel 4.8.0-1-686-pae cannot be found. Please install the linux-headers-4.8.0-1-686-pae package, or use the --kernelsourcedir option to tell DKMS where it's located 1. That error message is not coming from that file. In fact from no file with dkms in its name: $ dlocate --filename-only dkms|xargs grep Error.*You 2>&-|wc -l 0 2. Please also have the message mention if one then needs to reinstall linux-image-4.8.0-1-686-pae . (Seen when offine installing from a /var/cache/apt/archives/ that has some, but not all packages...)
Control: reassign -1 dkms [...] That's the hook script the kernel's postint script is running, that (indirectly) generates the error message. The error message *does* come from dkms. Ben.
I've encountered a similar issue today:
Setting up linux-image-5.10.0-2-amd64 (5.10.9-1) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-5.10.0-1-amd64
I: /initrd.img.old is now a symlink to boot/initrd.img-5.10.0-1-amd64
I: /vmlinuz is now a symlink to boot/vmlinuz-5.10.0-2-amd64
I: /initrd.img is now a symlink to boot/initrd.img-5.10.0-2-amd64
/etc/kernel/postinst.d/dkms:
dkms: WARNING: Linux headers are missing, which may explain the above failures.
please install the linux-headers-5.10.0-2-amd64 package to fix this.
There are no "above failures", so reading this warning message is
somewhat misleading. Of course, if dkms needs some extra package, it
should ideally depend on it in some way, but this seems to be
nontrivial and is already covered by other bug reports, such as
#762061 and #951404.
But perhaps it is possible to make the above warning conditional and
only print it if there actually were any errors?