Kernel version and kernel headers out of sync after kernel update

Creating a bug report/issue

[yes] I have searched the existing open and closed issues

Required Information

  • DietPi version | cat /boot/dietpi/.version

  • G_DIETPI_VERSION_CORE=9
    G_DIETPI_VERSION_SUB=11
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’

  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
    bookworm 0

  • Kernel version | uname --all
    Linux music-compiler 6.12.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.20-1+rpt1~bpo12+1 (2025-03-19) aarch64 GNU/Linux

  • Architecture | dpkg --print-architecture
    arm64

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
    RPi 4 Model B (aarch64)

  • Power supply used | (EG: 5V 1A RAVpower)
    DeskPi 12V power supply (case has 5V regulator)

  • SD card used | (EG: SanDisk ultra)
    Samsung Evo

Additional Information (if applicable)

  • Software title | (EG: Nextcloud)
  • Was the software title installed freshly or updated/migrated?
  • Can this issue be replicated on a fresh installation of DietPi?
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

  1. Install package raspberrypi-kernel-headers
  2. Update DietPi to 9.11
  3. Update kernel to 6.12.20 through apt upgrade
  1. After following above steps kernel will be 6.12.20, but /usr/src/ will contain kernel headers for 6.1.21 still and won’t have updated to the version corresponding to the new kernel

Expected behaviour

Kernel headers package should be tracking the distribution kernel version

Actual behaviour

Kernel headers package is remaining on version for old kernel

We don’t maintain kernel or headers packages ourselves. They are original one from RPi repositories. Did you install a specific headers package manually?

No, I just installed the standard kernel headers package, not a specific version, which is why I’d expect that it would track with the kernel version itself.

Since 6.6 you need another package: linux-headers-rpi-v8

see:
https://dietpi.com/forum/t/kernel-headers-missing-build-folder-after-updating-to-9-10/22752/10?u=jappe
https://www.raspberrypi.com/documentation/computers/linux_kernel.html#kernel-headers

1 Like

Thanks. That was exactly what I needed.

Of course now they’ve split out the headers into a common and an RPi-specific one then some compile paths that use $(uname -r) are now failing to properly resolve the anticipated headers, but that’s easy enough to work around.