Issue
My OS is debian 11 with kernel 5.8.0-2-amd64. I need "linux-headers-5.8.0-2-amd64" to make my own kernel module. Then, I use "apt-cache search" and "apt search" to find it, but both of them can't find it. Where can I download this header?
The following is the content of "/etc/apt/sources.list":
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
Solution
You have to download the header and install them.
http://ubuntuhandbook.org/index.php/2020/08/install-linux-kernel-5-8-ubuntu/
Here is a good tutorial how to compile a kernel and download the headers. In Newer version it's linux-headers-amd64
. You can try this in your version to get the headers for your version.
I have checked the versions. So you should make a dist-upgrade to the kernel which is in your repo.
https://packages.debian.org/bullseye/linux-headers-amd64
For Debian 11 it's 5.9 then you can install the headers from the repo if that is possible.
Answered By - René Höhle Answer Checked By - Katrina (WPSolving Volunteer)