I need the linux-headers for ubuntu mate 16.04 on a Raspberry Pi 3. It appears that the kernel is 4.1.19v7+ and I can only find linux-headers for 4.4 and higher. I think that the kernel is actually the same as used in Raspian but I still cannot find them. Where can I get them?
1 Answers
If you don't have any manually installed drivers like nvidia or wifi drivers, then you can run the following command to update your kernel and headers to the newest version:
sudo apt update
sudo apt install linux-generic
The package linux-generic
is a "meta package" which means that the package is only a group of dependency packages. This meta package has the dependencies of the latest kernel version. When you perform an upgrade, this package will install the latest version of both the kernel and the kernel header automatically.
To upgrade (update) your kernel version in the future, you will need to run sudo apt dist-upgrade
or sudo apt full upgrade
(both of these commands do the same thing) because sudo apt upgrade
will not upgrade your kernel.
If you do have manually installed drivers, you will need to reinstall the drivers after you upgrade the kernel.
I found this package using the following command:
apt-cache search linux-generic | grep linux-generic
For more info, run the following command:
apt-cache show linux-generic

- 43,546
- 8
- 97
- 150
-
1
-
@Rinzwind If OP wants 4.1 I think this is off topic because MATE 16.04 is EOL. If the question is specific to an end of life release (MATE 16.04) then it is off topic. However, if the OP wants to use the latest kernel, then the question is no longer specific to the release and applies to all 16.04 releases (also, this will fix the problem). – mchid Jul 25 '19 at 05:43
-
I am not very sophisticated wrt kernels but trying to learn. I installed the RaspberryPi image that was available long ago for ubuntu16.04 which probably has manually installed drivers for RP3 peripherals, and I am working in a community with about 25 clones of this install so upgrading all of them is an issue. I wanted to try my hand at a very simplistic kernel module, but if I upgrade one RPi, write a small driver, will it still run on the other RPis that are still running on 16.04 with kernel 4.1.19 – Terry L Anderson Jul 25 '19 at 23:07
-
@TerryLAnderson There are some posts about this on https://raspberrypi.stackexchange.com/ and also https://ubuntu-mate.community/t/ubuntu-mate-does-have-linux-headers-4-1-19-v7/5792/5. Additionally, I'm not sure but I think you need the proper headers for whatever kernel you are compiling the driver for. I've only compiled stuff for my own machine and have never done any cross compiling. – mchid Jul 26 '19 at 04:05
-
@TerryLAnderson Also, (again, you may need to reinstall some drivers that were not installed through
apt
if you update the kernel) there are many posts that mention usingsudo apt install raspberrypi-kernel raspberrypi-kernel-headers
and there is also another method mentioned to update the kernel as well. I found a lot of posts searching google for: "site:raspberrypi.stackexchange.com kernel headers". Your question may still be on topic at the https://raspberrypi.stackexchange.com website. – mchid Jul 26 '19 at 04:07
4.14.134
released last Sunday and it seems OK so far. See: https://askubuntu.com/questions/119080/how-to-update-kernel-to-the-latest-mainline-version-without-any-distro-upgrade/885165#885165 – WinEunuuchs2Unix Jul 24 '19 at 23:44