kharris
Posts: 1
Joined: Thu Apr 12, 2018 5:22 pm

Issue installing Linux Headers

Thu Apr 12, 2018 5:38 pm

I have a Raspberry Pi 3, running Stretch and I am trying to setup a USB driver for a motor controller. I'm trying to follow the instructions for setting up the driver, but I am running into the below issues when I try to execute the following command (which is step 1 of the instructions for setting up the driver):

Code: Select all

sudo apt-get install linux-headers-$(uname -r) 
which outputs:

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-headers-4.9.80-v7
E: Couldn't find any package by glob 'linux-headers-4.9.80-v7'
E: Couldn't find any package by regex 'linux-headers-4.9.80-v7'
In addition, when I execute:

Code: Select all

uname -mrs
I get:

Code: Select all

Linux 4.9.80-v7+ armv7l
Finally, I also tried checking which linux-headers are available with the following:

Code: Select all

apt-cache search linux-headers

Code: Select all

aufs-dkms - DKMS files to build and install aufs
linux-headers-3.10-3-all - All header files for Linux 3.10 (meta-package)
linux-headers-3.10-3-all-armhf - All header files for Linux 3.10 (meta-package)
linux-headers-3.10-3-common - Common header files for Linux 3.10-3
linux-headers-3.10-3-rpi - Header files for Linux 3.10-3-rpi
linux-headers-3.16.0-4-all - All header files for Linux 3.16 (meta-package)
linux-headers-3.16.0-4-all-armhf - All header files for Linux 3.16 (meta-package)
linux-headers-3.16.0-4-common - Common header files for Linux 3.16.0-4
linux-headers-3.16.0-4-rpi - Header files for Linux 3.16.0-4-rpi
linux-headers-3.18.0-trunk-all - All header files for Linux 3.18 (meta-package)
linux-headers-3.18.0-trunk-all-armhf - All header files for Linux 3.18 (meta-package)
linux-headers-3.18.0-trunk-common - Common header files for Linux 3.18.0-trunk
linux-headers-3.18.0-trunk-rpi - Header files for Linux 3.18.0-trunk-rpi
linux-headers-3.18.0-trunk-rpi2 - Header files for Linux 3.18.0-trunk-rpi2
linux-headers-3.6-trunk-all - All header files for Linux 3.6 (meta-package)
linux-headers-3.6-trunk-all-armhf - All header files for Linux 3.6 (meta-package)
linux-headers-3.6-trunk-common - Common header files for Linux 3.6-trunk
linux-headers-3.6-trunk-rpi - Header files for Linux 3.6-trunk-rpi
linux-headers-4.4.0-1-all - All header files for Linux 4.4 (meta-package)
linux-headers-4.4.0-1-all-armhf - All header files for Linux 4.4 (meta-package)
linux-headers-4.4.0-1-common - Common header files for Linux 4.4.0-1
linux-headers-4.4.0-1-rpi - Header files for Linux 4.4.0-1-rpi
linux-headers-4.4.0-1-rpi2 - Header files for Linux 4.4.0-1-rpi2
linux-headers-4.9.0-6-all - All header files for Linux 4.9 (meta-package)
linux-headers-4.9.0-6-all-armhf - All header files for Linux 4.9 (meta-package)
linux-headers-4.9.0-6-common - Common header files for Linux 4.9.0-6
linux-headers-4.9.0-6-common-rt - Common header files for Linux 4.9.0-6-rt
linux-headers-4.9.0-6-rpi - Header files for Linux 4.9.0-6-rpi
linux-headers-4.9.0-6-rpi2 - Header files for Linux 4.9.0-6-rpi2
linux-headers-rpi - Header files for Linux rpi configuration (meta-package)
linux-headers-rpi-rpfv - This metapackage will pull in the headers for the raspbian kernel for the
linux-headers-rpi2 - Header files for Linux rpi2 configuration (meta-package)
linux-headers-rpi2-rpfv - This metapackage will pull in the headers for the raspbian kernel for the
linux-libc-dev-alpha-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-arm64-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-armel-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-armhf-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-hppa-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-m68k-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mips-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mips64-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mips64el-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mipsel-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-powerpc-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-powerpcspe-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-ppc64-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-ppc64el-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-s390x-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-sh4-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-sparc64-cross - Linux Kernel Headers for development (for cross-compiling)
raspberrypi-kernel-headers - Header files for the Raspberry Pi Linux kernel
If anyone is able to offer insight into what I'm doing wrong or what the issue is, that would be AMAZING! Newish to RaspberryPi, so still learning.

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

Re: Issue installing Linux Headers

Fri Apr 13, 2018 2:53 pm

raspberrypi-kernel-headers is the package to match raspberry-kernel

B.Goode
Posts: 5827
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Issue installing Linux Headers

Fri Apr 13, 2018 3:20 pm

Try

Code: Select all

sudo apt update
again, followed by

Code: Select all

sudo apt install <<your requirements here>>

Pokerfjes
Posts: 6
Joined: Wed Aug 31, 2016 8:11 pm

Re: Issue installing Linux Headers

Sat Apr 14, 2018 6:32 pm

I think we have the same problem, but if we don't I'll butt out ;). I just downloaded latest image, apt-get updated and upgraded, then fetched the raspberrypi-kernel-headers package.

root@raspberrypi:~# uname -a
Linux raspberrypi 4.9.80-v7+ #1098 SMP Fri Mar 9 19:11:42 GMT 2018 armv7l GNU/Linux
root@raspberrypi:~# ls /lib/modules/
4.14.30+ 4.14.30-v7+

This is the location of the headers I think. Why do they contain headers for an old kernel.

B.Goode
Posts: 5827
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Issue installing Linux Headers

Sat Apr 14, 2018 7:38 pm

It could easily be irrelevant, but just on the chance that it is related, could you indulge my curiosity and try the trivial potential fix that I posted?

User avatar
scruss
Posts: 1673
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Issue installing Linux Headers

Sat Apr 14, 2018 7:44 pm

uname gives the version of the running kernel. If you haven't rebooted since updating, you'll still be running the old kernel.

The package the OP wants is raspberrypi-kernel-headers: no version required.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

Return to “Linux Kernel”

Who is online

Users browsing this forum: No registered users and 1 guest