LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-15-2021, 07:06 AM   #1
jt1122
Member
 
Registered: Apr 2021
Posts: 140

Rep: Reputation: Disabled
Kernel headers not found


I'm trying to install anbox and running INSTALL.sh gives:
Code:
Error! echo
Your kernel headers for kernel 5.10.0-4-amd64 cannot be found at
/lib/modules/5.10.0-4-amd64/build or /lib/modules/5.10.0-4-amd64/source.
You can use the --kernelsourcedir option to tell DKMS where it's located.
Error! echo
Your kernel headers for kernel 5.10.0-4-amd64 cannot be found at
/lib/modules/5.10.0-4-amd64/build or /lib/modules/5.10.0-4-amd64/source.
You can use the --kernelsourcedir option to tell DKMS where it's located.
neofetch shows:
Code:
Kernel: 5.10.0-4-amd64
Any suggestions?

Thanks
 
Old 05-15-2021, 07:39 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Yes, install the kernel headers!

Kernel headers are a separate package from the kernel as a running program. You only need them if you are going to build things. You don't say what distribution you are using (btw you should always give that info in a post) but whatever one it is, you can use the package manager to install the kernel-headers package.
 
Old 05-15-2021, 08:31 AM   #3
jt1122
Member
 
Registered: Apr 2021
Posts: 140

Original Poster
Rep: Reputation: Disabled
Thanks.

I'm on Sparky rolling (=Debian testing).
I've already installed linux-headers-amd64 and also linux-headers-sparky-amd64 but then I got the above error.

/lib/modules has the following folders:
5.9.0-4-amd64
5.10.0-4-amd64
5.10.0-6-amd64
5.12.4-sparky-amd64
 
Old 05-15-2021, 11:25 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,290

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
/lib/modules stores kernel modules (= drivers in M$-speak).

Kernel headers go in /usr/include/asm-generic, /usr/include/asm-x86, /usr/include/linux, and a bevvy of smaller directories and are lookup tables for compiling stuff.
 
Old 05-15-2021, 12:58 PM   #5
jt1122
Member
 
Registered: Apr 2021
Posts: 140

Original Poster
Rep: Reputation: Disabled
Thanks but what else do I need to install besides linux-headers-amd64 and linux-headers-sparky-amd64 ?.
 
Old 05-15-2021, 01:59 PM   #6
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Quote:
Originally Posted by jt1122 View Post
I'm trying to install anbox and running INSTALL.sh gives:
Code:
Error! echo
Your kernel headers for kernel 5.10.0-4-amd64 cannot be found at
/lib/modules/5.10.0-4-amd64/build or /lib/modules/5.10.0-4-amd64/source.
You can use the --kernelsourcedir option to tell DKMS where it's located.
One thing about Linux error messages is that they usually tell you not only that something
has gone wrong but what to do about it. This is a case in point. I have no idea why your installation script is looking for kernel headers in /lib/modules because they never go there in practice. As business_kid has said, they should be in /usr/include. So try giving the option
Code:
--kernelsourcedir=/usr/include
and see if that does the job.
 
Old 05-15-2021, 07:49 PM   #7
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by jt1122 View Post
Thanks but what else do I need to install besides linux-headers-amd64 and linux-headers-sparky-amd64 ?.
linux-headers and kernel-headers are not always the same. The error says you need the kernel headers. I install them with "dnf install kernel-headers" or "apt install kernel-headers" depending on which distro I am on. The package manager should be able to get them for you easily.
 
Old 05-15-2021, 08:20 PM   #8
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,340

Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
I have no idea why your installation script is looking for kernel headers in /lib/modules because they never go there in practice.
/lib/modules/<kernel_version>/build and /lib/modules/<kernel_version>/source are supposed to be symlinks to the kernel source root.
 
Old 05-15-2021, 08:38 PM   #9
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Quote:
/lib/modules has the following folders:
5.9.0-4-amd64
5.10.0-4-amd64
5.10.0-6-amd64
5.12.4-sparky-amd64
This would indicate that you have several kernels installed, two of them newer than the 5.10.0-4-amd64 you are booting into currently. You can be sure you have the kernel headers for whatever kernel you are booting with installed by running:
Code:
# apt install linux-headers-$(uname -r)
In Debian, the kernel headers package will be in the form linux-headers-<kernel name>. Also, Sparky is a rolling release based on Debian Testing. As such, you are likely to get kernel upgrades a lot more often than on a non-rolling distro. I don't know how Sparky handles these things but in stock Debian Stable, a kernel update does not automatically install the new kernel headers package along with the updated kernel. You have to remember to rerun the above command with each kernel update to get the kernel headers for the new kernel installed.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No package 'x11' found No package 'xext' found No package 'xdamage' found No package 'xfixes' found No package 'x11-xcb' found Jigsaw Linux From Scratch 14 02-23-2021 08:35 PM
[kernel-headers-3.2.45-x86-3] OR [kernel-headers-3.2.45_smp-x86-3]? Sefid par Slackware 3 07-24-2013 09:59 AM
Directory not found; -xzvf not found; Makefile not found RealGomer Linux - Software 4 09-20-2010 10:02 AM
Zypper wants to dl the wrong kernel headers... YaST doesnt have current headers zorb SUSE / openSUSE 2 11-28-2009 11:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration