In this article, we will show you how to install the Linux kernel headers on Debian 12 “Bookworm”.
Topic of Contents:
- Updating the Debian 12 System
- Updating the Debian 12 Package Repository Cache
- Checking the Version of the Installed Linux Kernel on Debian 12
- Installing the Linux Kernel Headers on Debian 12
- Conclusion
Updating the Debian 12 System
Before you install the Linux kernel headers on your Debian 12 system, it’s a good idea to install all the available updates on your Debian 12 system.
If you need any assistance in updating your Debian 12 system, read the article on How to Keep Debian 12 System Up-to-Date.
Once you updated your Debian 12 system, reboot your computer for the changes to take effect with the following command:
Updating the Debian 12 Package Repository Cache
To update the Debian 12 package repository cache, run the following command:
Checking the Version of the Installed Linux Kernel on Debian 12
To check the version of the Linux kernel that you’re using on your Debian 12 system, run the following command:
As you can see, our Debian 12 computer is using the Linux kernel version 6.1.0. The version of the Linux kernel headers that you install must match the version of the Linux kernel that you installed on your Debian 12 system. Otherwise, the software that requires them to compile its kernel modules won’t be able to access it.
Installing the Linux Kernel Headers on Debian 12
To install the same version of the Linux kernel headers as the Linux kernel that you’re using on your Debian 12 system, run the following command:
To confirm the installation, press Y and then press <Enter>.
The Linux kernel headers and the required dependency packages are being downloaded from the internet. It takes a while to complete.
The Linux kernel headers and the required dependency packages are being installed. It takes a while to complete.
At this point, the correct version of the Linux kernel headers should be installed on your Debian 12 system.
Conclusion
We showed you how to install the correct version of the Linux kernel headers on a Debian 12 system so that the software that requires it can use it to compile its kernel modules on Debian 12.