Raspberrypi kernel headers

Hi, I would like to install raspberrypi-kernel-headers to compile driver for my network card with Realtek chipset 88x2bu, and it cannot be found

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package raspberrypi-kernel-headers

How I can install those headers?

My Kernel version:
Linux goldenTK-core 5.10.17-v8+ #1403 SMP PREEMPT Mon Feb 22 11:37:54 GMT 2021 aarch64 GNU/Linux

Hi,

it’s not really a question for DietPi as we are not providing the kernel. It’s more a question for Raspberry OS. :wink:

Can you do following to search the package

apt show raspberrypi-kernel-headers

At least on my system the package is shown

root@DietPi4:~# apt show raspberrypi-kernel-headers
Package: raspberrypi-kernel-headers
Version: 1:1.20210430-2
Priority: optional
Section: kernel
Source: raspberrypi-firmware
Maintainer: Serge Schneider <serge@raspberrypi.org>
Installed-Size: 59.8 MB
Provides: linux-headers
Homepage: https://github.com/raspberrypi/firmware
Download-Size: 9331 kB
APT-Sources: https://archive.raspberrypi.org/debian buster/main arm64 Packages
Description: Header files for the Raspberry Pi Linux kernel
 This package provides the architecture-specific kernel header files for
 the Raspberry Pi Linux kernel, generally used for building out-of-tree
 kernel modules.

root@DietPi4:~#
dietpi@goldenTK-core:~/src/88x2bu $ apt show raspberrypi-kernel-headers
N: Unable to locate package raspberrypi-kernel-headers
N: Unable to locate package raspberrypi-kernel-headers
E: No packages found

How I can get it? I used latest version from dietpi site.

This has nothing to do with DietPi as the image used is Raspberry OS. can you share your apt source list

cat /etc/apt/sources.list.d/raspi.list
dietpi@goldenTK-core:~/src/88x2bu $ cat /etc/apt/sources.list.d/raspi.list
deb https://archive.raspberrypi.org/debian/ buster main

I tried to update dietpi but I’ve got this error…

pls can you share full output of

apt update && apt upgrade

PS: pls try to copy the output from SSH terminal and avoid doing screen shots

sudo apt update && apt upgrade
Hit:1 https://deb.debian.org/debian buster InRelease
Get:2 https://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:3 https://archive.raspberrypi.org/debian buster InRelease [32.7 kB]
Get:4 https://deb.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:5 https://deb.debian.org/debian buster-backports InRelease [46.7 kB]
Reading package lists... Done        
E: Release file for https://deb.debian.org/debian/dists/buster-updates/InRelease is not valid yet (invalid for another 34d 12h 27min 0s). Updates for this repository will not be applied.
E: Release file for https://archive.raspberrypi.org/debian/dists/buster/InRelease is not valid yet (invalid for another 33d 18h 36min 43s). Updates for this repository will not be applied.
E: Release file for https://deb.debian.org/debian-security/dists/buster/updates/InRelease is not valid yet (invalid for another 33d 20h 21min 41s). Updates for this repository will not be applied.
E: Release file for https://deb.debian.org/debian/dists/buster-backports/InRelease is not valid yet (invalid for another 34d 12h 27min 0s). Updates for this repository will not be applied.

pls update your system time

/boot/dietpi/func/run_ntpd 1

Ohh, that works, thanks bro :slight_smile:

are you able to install the header now?

yes

Another question, I tried to compile driver for my network card but I’m getting this
Do you know what could go wrong?

DKMS make.log for rtl88x2bu-5.6.1 for kernel 5.10.17-v8+ (aarch64)
Thu May 27 11:15:24 CEST 2021
make ARCH=arm CROSS_COMPILE= -C /lib/modules/5.10.17-v8+/build M=/var/lib/dkms/rtl88x2bu/5.6.1/build  modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.17-v8+'
  CC [M]  /var/lib/dkms/rtl88x2bu/5.6.1/build/core/rtw_cmd.o
gcc: error: unrecognized argument in option ‘-mabi=apcs-gnu’
gcc: note: valid arguments to ‘-mabi=’ are: ilp32 lp64
  CC [M]  /var/lib/dkms/rtl88x2bu/5.6.1/build/core/rtw_security.o
gcc: error: unrecognized argument in option ‘-mabi=apcs-gnu’
gcc: note: valid arguments to ‘-mabi=’ are: ilp32 lp64
  CC [M]  /var/lib/dkms/rtl88x2bu/5.6.1/build/core/rtw_debug.o
gcc: error: unrecognized command line option ‘-mapcs’; did you mean ‘--specs’?
gcc: error: unrecognized argument in option ‘-mabi=apcs-gnu’
gcc: note: valid arguments to ‘-mabi=’ are: ilp32 lp64
gcc: error: unrecognized command line option ‘-mapcs’; did you mean ‘--specs’?
  CC [M]  /var/lib/dkms/rtl88x2bu/5.6.1/build/core/rtw_io.o
gcc: error: unrecognized command line option ‘-mno-sched-prolog’; did you mean ‘-Wno-sign-promo’?
gcc: error: unrecognized command line option ‘-mapcs’; did you mean ‘--specs’?
gcc: error: unrecognized command line option ‘-msoft-float’
gcc: error: unrecognized argument in option ‘-mabi=apcs-gnu’
gcc: note: valid arguments to ‘-mabi=’ are: ilp32 lp64
gcc: error: unrecognized command line option ‘-mno-sched-prolog’; did you mean ‘-Wno-sign-promo’?
make[2]: *** [scripts/Makefile.build:279: /var/lib/dkms/rtl88x2bu/5.6.1/build/core/rtw_cmd.o] Error 1
make[2]: *** Waiting for unfinished jobs....
gcc: error: unrecognized command line option ‘-msoft-float’
make[2]: *** [scripts/Makefile.build:279: /var/lib/dkms/rtl88x2bu/5.6.1/build/core/rtw_security.o] Error 1
gcc: error: unrecognized command line option ‘-mno-sched-prolog’; did you mean ‘-Wno-sign-promo’?
gcc: error: unrecognized command line option ‘-mapcs’; did you mean ‘--specs’?
gcc: error: unrecognized command line option ‘-msoft-float’
make[2]: *** [scripts/Makefile.build:279: /var/lib/dkms/rtl88x2bu/5.6.1/build/core/rtw_debug.o] Error 1
gcc: error: unrecognized command line option ‘-mno-sched-prolog’; did you mean ‘-Wno-sign-promo’?
gcc: error: unrecognized command line option ‘-msoft-float’
make[2]: *** [scripts/Makefile.build:279: /var/lib/dkms/rtl88x2bu/5.6.1/build/core/rtw_io.o] Error 1
make[1]: *** [Makefile:1804: /var/lib/dkms/rtl88x2bu/5.6.1/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.17-v8+'
make: *** [Makefile:2284: modules] Error 2

I’m not a specialist in compiling stuff but I see you are using ARCH=arm. But your system is a 64bit Raspberry Pi OS and your would need to use ARCH=“arm64” I guess. This would somehow fit the following I found on Google

https://github.com/gnab/rtl8812au/issues/170