Q: How to install the kernel header on Raspberry Pi OS

A: You can install with the latest kernel header updating list by [apt update] command.

You can indicate the version of kernel header by the dedicated kernel header acquisition command on Ubuntu or RedHat.
However, you only get the latest kernel header on Raspberry Pi OS.

Contec recommends you use the exact same kernel header version which is already confirmed to execute API-TOOL(LNX) normally.
And you can confirm the current kernel version and kernel header version by the following command.

dpkg -l | grep raspberrypi-kernel

 

The way to install arbitrary kernel header.

1. Please download "deb file" which is included the correct kernel header from the following URL.

    https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/

2. Please copy "deb file" to the Raspberry Pi OS which you want. And execute the following command.

    sudo dpkg -i "deb filename"

3. You can install the kernel header which you indicate to your Raspberry Pi OS with the following command.

    sudo apt-get install raspberrypi-kernel-headers

 

The way to re-confirm the version of kernel header in downloaded "deb file"

1. Please extract "deb file" which you download.

2. There are sub-folders inside "lib/module" directory after you extract.
   And please make sure the name of sub-folder names.