Page 1 of 1

Ubuntu 18.04 Kernel header file

Posted: Fri May 15, 2020 3:14 am
by calgalli
I have to compile a driver for a device. It requires Kernel header file. Where can I find the installation package for Kernel header file. Thank you

Re: Ubuntu 18.04 Kernel header file

Posted: Thu May 21, 2020 6:20 pm
by npropanol
You have to compile the headers from the source - basic instructions are here:
http://wiki.friendlyarm.com/wiki/index. ... n_OS_Image

I think I did
make ARCH=arm64 nanopi4-images headers_install deb-pkg
from a PC running ubuntu then installed the .deb on my NanoPi-M4.
A couple of things - I had to do a
make deb-pkg LOCALVERSION= KDEB_PKGVERSION=
otherwise it added a bunch of stuff to the filename so then the headers name didn't match.
Also, I think I had to add a patch from here:
https://forum.armbian.com/topic/9540-li ... -with-fix/
as the headers were coming out incomplete. The patch is about halfway down the page -
"fix-linux-headers-rk3399-pkg-v2.patch"
https://forum.armbian.com/applications/ ... hp?id=4021

Hope this helps.
Good Luck!

Re: Ubuntu 18.04 Kernel header file

Posted: Sun May 24, 2020 11:08 am
by igorp
calgalli wrote:
I have to compile a driver for a device. It requires Kernel header file. Where can I find the installation package for Kernel header file. Thank you


Works with Armbian https://www.armbian.com/download/?tx_maker=friendlyelec

Re: Ubuntu 18.04 Kernel header file

Posted: Wed May 27, 2020 2:06 am
by calgalli
igorp wrote:
calgalli wrote:
I have to compile a driver for a device. It requires Kernel header file. Where can I find the installation package for Kernel header file. Thank you


Works with Armbian https://www.armbian.com/download/?tx_maker=friendlyelec


I have tried Armbian everything is ok but Armbian cannot detect camera. I also installed the header file from Armbian on Friendly Arm Ubuntu. It compiles the driver OK but it cannot load.

Re: Ubuntu 18.04 Kernel header file

Posted: Wed May 27, 2020 2:07 am
by calgalli
npropanol wrote:
You have to compile the headers from the source - basic instructions are here:
http://wiki.friendlyarm.com/wiki/index. ... n_OS_Image

I think I did
make ARCH=arm64 nanopi4-images headers_install deb-pkg
from a PC running ubuntu then installed the .deb on my NanoPi-M4.
A couple of things - I had to do a
make deb-pkg LOCALVERSION= KDEB_PKGVERSION=
otherwise it added a bunch of stuff to the filename so then the headers name didn't match.
Also, I think I had to add a patch from here:
https://forum.armbian.com/topic/9540-li ... -with-fix/
as the headers were coming out incomplete. The patch is about halfway down the page -
"fix-linux-headers-rk3399-pkg-v2.patch"
https://forum.armbian.com/applications/ ... hp?id=4021

Hope this helps.
Good Luck!


Thank you I will give it a try. BTW do you still have Debian package of the header file? If so, could you share?

Re: Ubuntu 18.04 Kernel header file

Posted: Fri Aug 14, 2020 10:24 am
by mikestanley464
First check your installed kernel version as well as kernel header package that matches your kernel version using following commands.

$ uname -r
$ apt search linux-headers-$(uname -r)
Check Kernel Version and Kernel Headers in Ubuntu
Check Kernel Version and Kernel Headers in Ubuntu
On Debian, Ubuntu and their derivatives, all kernel header files can be found under /usr/src directory. You can check if the matching kernel headers for your kernel version are already installed on your system using the following command.

$ ls -l /usr/src/linux-headers-$(uname -r)
Check Kernel Headers in Ubuntu
Check Kernel Headers in Ubuntu

From the above output, it’s clear that the matching kernel header directory doesn’t exist, meaning the package is not yet installed.

Before you can install the appropriate kernel headers, update your packages index, in order to grab information about the latest package releases, using the following command.

$ sudo apt update
Then run the following command that follows to install the Linux Kernel headers package for your kernel version.

$ sudo apt install linux-headers-$(uname -r)
Install Kernel Headers in Ubuntu
Install Kernel Headers in Ubuntu
Next, check if the matching kernel headers have been installed on your system using the following command

$ ls -l /usr/src/linux-headers-$(uname -r)
Verify Installed Kernel Headers in Ubuntu
Verify Installed Kernel Headers in Ubuntu
That’s all! In this article, we have explained how to install kernel headers in Ubuntu and Debian Linux and other distributions in the Debian family tree.

Always keep in mind that to compile a kernel module, you will need the Linux kernel headers. If you have any quires, or thoughts to share, use the comment form below to reach us.

Re: Ubuntu 18.04 Kernel header file

Posted: Tue Aug 25, 2020 9:02 pm
by mikestanley464
mikestanley464 wrote:
First check your installed kernel version as well as kernel header package that matches your kernel version using following commands.

$ uname -r
$ apt search linux-headers-$(uname -r)
Check Kernel Version and Kernel Headers in Ubuntu https://bluestacks.red https://omegle.red/
Check Kernel Version and Kernel Headers in Ubuntu
On Debian, Ubuntu and their derivatives, all kernel header files can be found under /usr/src directory. You can check if the matching kernel headers for your kernel version are already installed on your system using the following command.

$ ls -l /usr/src/linux-headers-$(uname -r)
Check Kernel Headers in Ubuntu
Check Kernel Headers in Ubuntu

From the above output, it’s clear that the matching kernel header directory doesn’t exist, meaning the package is not yet installed.

Before you can install the appropriate kernel headers, update your packages index, in order to grab information about the latest package releases, using the following command.

$ sudo apt update
Then run the following command that follows to install the Linux Kernel headers package for your kernel version.

$ sudo apt install linux-headers-$(uname -r)
Install Kernel Headers in Ubuntu
Install Kernel Headers in Ubuntu
Next, check if the matching kernel headers have been installed on your system using the following command

$ ls -l /usr/src/linux-headers-$(uname -r)
Verify Installed Kernel Headers in Ubuntu
Verify Installed Kernel Headers in Ubuntu
That’s all! In this article, we have explained how to install kernel headers in Ubuntu and Debian Linux and other distributions in the Debian family tree.

Always keep in mind that to compile a kernel module, you will need the Linux kernel headers. If you have any quires, or thoughts to share, use the comment form below to reach us.


First check your installed kernel version as well as kernel header package that matches your kernel version using following commands.

$ uname -r
$ apt search linux-headers-$(uname -r)
Check Kernel Version and Kernel Headers in Ubuntu
Check Kernel Version and Kernel Headers in Ubuntu
On Debian, Ubuntu and their derivatives, all kernel header files can be found under /usr/src directory. You can check if the matching kernel headers for your kernel version are already installed on your system using the following command.

$ ls -l /usr/src/linux-headers-$(uname -r)
Check Kernel Headers in Ubuntu
Check Kernel Headers in Ubuntu

From the above output, it’s clear that the matching kernel header directory doesn’t exist, meaning the package is not yet installed.

Before you can install the appropriate kernel headers, update your packages index, in order to grab information about the latest package releases, using the following command.

$ sudo apt update
Then run the following command that follows to install the Linux Kernel headers package for your kernel version.

$ sudo apt install linux-headers-$(uname -r)
Install Kernel Headers in Ubuntu
Install Kernel Headers in Ubuntu
Next, check if the matching kernel headers have been installed on your system using the following command

$ ls -l /usr/src/linux-headers-$(uname -r)
Verify Installed Kernel Headers in Ubuntu
Verify Installed Kernel Headers in Ubuntu
That’s all! In this article, we have explained how to install kernel headers in Ubuntu and Debian Linux and other distributions in the Debian family tree.

Always keep in mind that to compile a kernel module, you will need the Linux kernel headers. If you have any quires, or thoughts to share, use the comment form below to reach us.