I've seen a few questions about linux-headers packages but couldn't find anything to address my specific issue.
I'm on Kubuntu 16.04, and I got the following error (from VirtualBox):
Please install the Linux kernel "header" files matching the current kernel for adding new hardware support to the system. The distribution packages containing the headers are probably:
linux-headers-generic linux-headers-4.13.0-43-generic
I was surprised to see that linux-headers-generic
was not installed, although I'm not really sure if it's supposed to be there by default.
In any case, while the kernel is 4.13.0-43-generic, the corresponding headers are, indeed, not installed:
$ uname -r
4.13.0-43-generic
$ aptitude search linux-headers | grep ^i
id linux-headers-4.13.0-32 - Header files related to Linux kernel versi
id linux-headers-4.13.0-32-generic - Linux kernel headers for version 4.13.0 on
i A linux-headers-4.13.0-37 - Header files related to Linux kernel versi
i A linux-headers-4.13.0-37-generic - Linux kernel headers for version 4.13.0 on
i A linux-headers-4.13.0-38 - Header files related to Linux kernel versi
i A linux-headers-4.13.0-38-generic - Linux kernel headers for version 4.13.0 on
i A linux-headers-4.13.0-39 - Header files related to Linux kernel versi
i A linux-headers-4.13.0-39-generic - Linux kernel headers for version 4.13.0 on
The linux-headers-generic
"will always depend on the latest generic kernel headers available", so I thought that installing it would install the latest packages (in this case, linux-headers-4.13.0-43-generic
as required by VirtualBox) and keep them up to date.
However, if I try that, I'm asked to install what appear to be really old packages:
$ sudo aptitude install linux-headers-generic
The following NEW packages will be installed:
linux-headers-4.4.0-127{a} linux-headers-4.4.0-127-generic{a} linux-headers-generic
0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.8 MB of archives. After unpacking 78.4 MB will be used.
There's also a package called linux-headers-generic-lts-xenial
, but it does, more or less, the same thing.
So, my questions:
- Should either of the linux-headers-generic packages have been there by default? Which one?
- Do I need to install either of them in my case?
- If I install the necessary
linux-headers-4.13.0-43-generic
package directly, what happens when the kernel is upgraded?
No. Neither.
From the kernel versions, it looks like you are using the hardware-enablement-stack (HWE) kernel. So you should install the headers for those:
linux-headers-generic-hwe-16.04
, the meta-package that should depend on the correct header package for your HWE kernel (4.13).You'd have to again manually install the relevant headers. It's better to use
linux-headers-generic-hwe-16.04
.The easiest solution is to install the missing packages:
My system already has installed what yours is missing. Why they're missing I can't say.
Notice for
linux-headers-generic
the most current version is indeed4.4.0.127.133
. Although Linux Kernel 4.4 came out in 2015 it is an LTS (Long Term Support) kernel for 5 or 6 years (can't remember exactly) and it is currently on update number 127. So the update number will eventually grow to 300 or so.No matter how you look at it, you need to just bite the bullet and install the missing headers using:
June 11, 2018 update.
4.4.0.127.133
is no longer the latest header version. I ransudo apt upgrade
and then later ransudo apt autoremove
. I received some error messages as schizophrenic software removed127
and told me to add127
headers to fix the problem:There is no real problem though and as of June 11, 2018 the latest
linux-headers-generic
version is:4.4.0.128.134
.My colleague was using 18.10 and 4.18.0.17 kernel.
sudo apt-get install
the corresponding linux-headers from official says package not found.I finally found and downloaded the specific files from packages.ubuntu.com:
http://mirrors.kernel.org/ubuntu/pool/main/l/linux-hwe/linux-headers-4.18.0-17_4.18.0-17.18~18.04.1_all.deb
http://mirrors.kernel.org/ubuntu/pool/main/l/linux-hwe/linux-headers-4.18.0-17-generic_4.18.0-17.18~18.04.1_amd64.deb
Once you have the header files installed.
apt-get purge
thenapt-get install
the virtualbox package should work.