rpi_nel
Posts: 2
Joined: Tue Jul 19, 2016 5:51 am

How to install kernel-headers

Tue Jul 19, 2016 6:21 am

Hello Everyone,

I'm a newbie in linux and I'm trying to install a software that requires kernel headers. My rpi kernel is "Linux raspberrypi 4.4.11+ #888".

I already tried installing the package "Linux-headers-4.4.11+_4.4.11+-2.deb", which I got from another forum, but with no luck! Below is the error.

make -C /lib/modules/4.4.11+/build M=/opt/usb-redirector-linux-arm-eabi/files/modules/src/tusbd modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.11+'
CC [M] /opt/usb-redirector-linux-arm-eabi/files/modules/src/tusbd/driver.o
In file included from include/linux/ktime.h:25:0,
from include/linux/rcupdate.h:47,
from include/linux/srcu.h:33,
from include/linux/notifier.h:15,
from include/linux/memory_hotplug.h:6,
from include/linux/mmzone.h:735,
from include/linux/gfp.h:5,
from include/linux/slab.h:14,
from /opt/usb-redirector-linux-arm-eabi/files/modules/src/tusbd/usbd.h:14,
from /opt/usb-redirector-linux-arm-eabi/files/modules/src/tusbd/driver.c:12:
include/linux/jiffies.h:10:33: fatal error: generated/timeconst.h: No such file or directory
compilation terminated.
scripts/Makefile.build:258: recipe for target '/opt/usb-redirector-linux-arm-eabi/files/modules/src/tusbd/driver.o' failed
make[2]: *** [/opt/usb-redirector-linux-arm-eabi/files/modules/src/tusbd/driver.o] Error 1
Makefile:1384: recipe for target '_module_/opt/usb-redirector-linux-arm-eabi/files/modules/src/tusbd' failed
make[1]: *** [_module_/opt/usb-redirector-linux-arm-eabi/files/modules/src/tusbd] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.11+'
Makefile:61: recipe for target 'default' failed
make: *** [default] Error 2

I already got another set of files called, "linux-rpi-4.4.y". But, I don't have any idea on how to run it. Appreciate, if someone could guide me on how to install the required kernel headers.

epoch1970
Posts: 3655
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: How to install kernel-headers

Tue Jul 19, 2016 1:40 pm

You can try "sudo apt-get install raspberrypi-kernel-headers" if you're running raspbian.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

rpi_nel
Posts: 2
Joined: Tue Jul 19, 2016 5:51 am

Re: How to install kernel-headers

Wed Jul 20, 2016 10:45 am

Thanks! that solves my issue.

User avatar
cresfang
Posts: 37
Joined: Fri Apr 29, 2016 3:03 am
Location: Garden of Time
Contact: Website

Re: How to install kernel-headers

Tue Oct 18, 2016 4:19 am

How long does it take to complete the header install?
mine is stuck at: Unpacking raspberrypi-kernel-headers (1.20160921-1)....
for almost 20mins already.....
Raspberry Pi 3

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5954
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: How to install kernel-headers

Tue Oct 18, 2016 9:24 am

dpkg doesn't handle packages with many files very well. It's calculating the md5sum of every single file, on a single core while shuffling files around. 20 minutes seems a bit much, but doesn't surprise me, since that package has a LOT of files.

boeboe
Posts: 5
Joined: Wed Aug 24, 2011 7:56 pm

Re: How to install kernel-headers

Sun Oct 23, 2016 11:46 pm

I finally got around my missing Build Includes to this point:
checking for /lib/modules/4.1.19+/build/include... yes
by downloading the correct version from https://www.niksula.hut.fi/~mhiienka/Rp ... aders-rpi/
and installing it with:

Code: Select all

sudo dpkg -i linux-headers-4.1.19+_4.1.19+-2_armhf.deb
Thanks to ~mhiienka,

Boeboe

citizen38
Posts: 2
Joined: Mon Jan 09, 2017 3:26 pm

Re: How to install kernel-headers

Mon Jan 09, 2017 3:34 pm

I am running kernel 4.4.38 as was updated by rpi-update today

I need to get the kernel headers for this kernel but when I do "sudo apt-get install raspberrypi-kernel-headers" it downloads kernel headers for 4.4.34+

There is no GIT id for kernel version 4.4.34 - it jumps from 4.4.33 to 4.4.35 so I can't do a rpi-update to that version.

What is the easiest way to get a kernel and headers version that can match?

Thanks for your help.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5954
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: How to install kernel-headers

Mon Jan 09, 2017 4:35 pm

citizen38 wrote:I am running kernel 4.4.38 as was updated by rpi-update today

I need to get the kernel headers for this kernel but when I do "sudo apt-get install raspberrypi-kernel-headers" it downloads kernel headers for 4.4.34+

There is no GIT id for kernel version 4.4.34 - it jumps from 4.4.33 to 4.4.35 so I can't do a rpi-update to that version.

What is the easiest way to get a kernel and headers version that can match?

Thanks for your help.
You'll have to grab the kernel source for github.

citizen38
Posts: 2
Joined: Mon Jan 09, 2017 3:26 pm

Re: How to install kernel-headers

Mon Jan 09, 2017 5:23 pm

That sounds straightforward. Not being an expert though, could you point me in the direction of how I may set about doing this? Cheers

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5954
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: How to install kernel-headers

Mon Jan 09, 2017 9:10 pm

https://github.com/raspberrypi/linux
https://git-scm.com/book/en/v2/Git-Basi ... Repository

Cloning that git repo will get you the latest kernel source, which usually matches the kernel you get using rpi-update.

User avatar
DougieLawson
Posts: 36096
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: How to install kernel-headers

Tue Jan 10, 2017 12:52 am

it's easier to use Notro's rpi-source script
https://github.com/notro/rpi-source
that gets the source that matches your current running kernel.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

tvlad17
Posts: 3
Joined: Thu Aug 25, 2016 9:50 am

Not correct kernel version on Ubuntu(RPi 3)

Wed Jun 14, 2017 9:37 am

Hello. I have a problem. Description below. When I called

Code: Select all

umane -a
result is

Code: Select all

Linux pi 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux
The problem is when I want to install new drivers, the system gives me the error:

Code: Select all

make[1]: *** /lib/modules/4.1.19-v7+/build: No such file or directory.  Stop.
And it's really crazy because when I am looking inside of the

Code: Select all

 /lib/modules/
I can find only version 4.4.38-v7+. Maybe someone knows what it can be?
Thanks.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5954
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: How to install kernel-headers

Wed Jun 14, 2017 11:53 am

tvlad17 wrote:Hello. I have a problem. Description below. When I called

Code: Select all

umane -a
result is

Code: Select all

Linux pi 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux
The problem is when I want to install new drivers, the system gives me the error:

Code: Select all

make[1]: *** /lib/modules/4.1.19-v7+/build: No such file or directory.  Stop.
And it's really crazy because when I am looking inside of the

Code: Select all

 /lib/modules/
I can find only version 4.4.38-v7+. Maybe someone knows what it can be?
Thanks.
What's the output of

Code: Select all

apt-cache policy raspberrypi-kernel raspberrypi-kernel-headers

tvlad17
Posts: 3
Joined: Thu Aug 25, 2016 9:50 am

Re: How to install kernel-headers

Thu Jun 15, 2017 5:49 am

I used the recommendation from here https://raspberrypi.stackexchange.com/q ... 2au-driver and everything work.

Return to “Beginners”