Kernel header files

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
Posts: 1
Joined: Sun Sep 19, 2021 10:22 pm

Kernel header files

Post by doka1997 »

Hi, I’m trying to build a driver that requires kernel header files…

The driver’s Makefile expects header files in the /lib/modules/$(shell uname -r)/build/ directory, however there’s no build/ directory in the /usr/lib/modules/5.10.60-v8+

Suggested sudo apt install -y linux-headers-$(uname -r) says it’s unable to locate package linux-headers-5.10.60-v8
(I’ve done apt update, prior to that).

As a side note, I'm noticing that the apt install command ignores the '+' sign at the end of the kernel version. I've tried explicitly specifying the kernel version with a quotes around it, but it still seems to ignore it...

My question is where can I find (or download) the build directory for the 5.10.60-v8+ kernel header files?
User avatar
Site Admin
Posts: 3357
Joined: Sat Nov 18, 2017 6:21 pm

Re: Kernel header files

Post by MichaIng »

On Raspberry Pi, kernel and headers packages have a little uncommon names:

Code: Select all

apt install raspberrypi-kernel-headers
Purge any other kernel and headers you have installed. Those are not used by the RPi.
Post Reply