Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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
/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.
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
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.
/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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.