I have problem to install
linux-headers in Raspbian on my RPi2. My kernel version is 4.1.17-v7+. I can't find the
linux-headers package with
You can try
sudo apt-get install raspberrypi-kernel-headers if you're running raspbian.
As suggested here https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=154749
At the moment there is no
linux-headers for the 4.1.17 kernel version.
There are only headers for the 4.1.19 version for the 4.x branch. You can simply upgrade your kernel to the 4.1.19 version (now the newest stable branch showing 4.1.20):
sudo rpi-update f406502f5628d32e6ca5dadac34ff7ca59f8e27f
After install reboot your device and check typing
uname -r if there is a 4.1.19-v7+ version. If it's OK, install linux-headers:
sudo apt-get install linux-headers-4.1.19-v7+