I installed the newest available image from here which was Kali 64 bit v2017.2.

However, using the command apt-get install headers-linux-$(uname -r) returns the message:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package headers-linux-4.12.0-kali1-amd64
E: Couldn't find any package  by glob 'headers-linux-4.12.0-kali1-amd64'
E: Couldn't find any package  by regex 'headers-linux-4.12.0-kali1-amd64'

When I check the pool, it looks like all of the headers are marked as 4.13.0.

Two headed question then: Where do I get the headers for headers-linux-4.12.0-kali1-amd64, or where do I find the ISO image file for Kali 4.13.x?

  • 1
    sudo apt update && sudo apt upgrade && sudo apt dist-upgrade && sudo apt install linux-headers-$(uname -r) – defalt Nov 21 '17 at 7:15

On kali linux rolling release the package will be continuously updated , the old package will be removed and replaced by the newest version. on your system you have an old kernel image linux-image-4.12.0-kali1-amd64 , it is no longer available on the kali linux repository , Also its linux-headers-4.12.0-kali1-amd64 will be removed too.

After the system update (apt update) you can check the available linux-image and linux-headers through:

apt-cache search linux-image
apt-cache serach linux-headers

based on the apt-cache output you can install a specific linux-image and linux-headers package .

the must important part do not use the apt install linux-headers-$(uname -r) , the uname -r it will point to 4.12.0-kali1-amd64 headers package which it is no longer available it will work after installing a new linux-image and booting the new kernel.

installing the linux-image and the linux-headers without rebooting , the linux-headers package will be useful after the system reboot.

apt install linux-image-4.12.0-kali2-amd64
apt install linux-headers-4.12.0-kali2-amd64

Or , install the linux-image :

apt install linux-image-4.12.0-kali2-amd64

Reboot your system then install the linux-headers:

apt install linux-headers-$(uname -r)

now the uname -r should point to the 4.12.0-kali2-amd64 kernel headers version.

The easy way is to upgarade entirely your system followig those steps:

apt update
apt upgrade
apt dist-upgrade

then install the linux-headers:

apt install linux-headers-$(uname -r)
apt autoremove

The uname -a will display:


On kali-linux rolling the /etc/apt/sources.list should contain only the following line (kali docs):

deb http://http.kali.org/kali kali-rolling main contrib non-free
|improve this answer|||||
  • 1
    If you are doing a apt dist-upgrade anyway, do you really need the apt upgrade first? – bu5hman Nov 21 '17 at 17:08
  • 1
    @GAD3R This was amazingly helpful. I hadn't realized there was a difference between the main images and the rolling version. For future readers, I'd advise installing rolling as a first step using the process outlined in "Want an Updated or Custom Kali Image?" on kali.org/downloads – Alex Schneider Nov 21 '17 at 18:25
  • @bu5hman It is not necessary , but it is important if you have the apt-listbugsinstalled on your system. – GAD3R Nov 25 '17 at 12:19
  • @GAD3R Fair enough, though it seems mildly inconsistent to worry too much about anything but the severest bugs when the repository is Kali rolling...... – bu5hman Nov 25 '17 at 13:47
  • 1
    After many googling and trying wrong solutions for 3 hours, this was from far the best answer to the same question from me. Many Thx – hornetbzz Dec 18 '17 at 2:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.