How To Update/Install Kernel Headers in Kali Linux

     Installing the Kernel Headers in Kali Linux is sometimes necessary to install certain tools or software (i.e. VMware Tools). Follow this tutorial to learn how to do it. If you’re having trouble following the text tutorial, or if you wish to see a video of this process, please check out our video of this process.


Step One:

First, we need to make sure that the official Kali Linux repositories are added to the “sources.list” file.

Open a Terminal and type leafpad /etc/apt/sources.list and press Enter.



Step Two:

In the file that opens, look over it. If it contains all the lines listed below, then you can close it and continue on to Step Three. However, if it is empty or contains text different than the text listed below, delete everything inside it and replace it with the below text:

deb kali main non-free contrib

deb kali/updates main contrib non-free

deb-src kali main non-free contrib

deb-src kali/updates main contrib non-free

If you have to manually type it, be sure to double check it, as even the slightest error will result in Kali Linux not updating properly.

Once you have finished, close leafpad and click Yes when it asks you if you want to save the changes.



Step Three:

Now, in the Terminal, type the below command:

apt-get update && apt-get install -y linux-headers-$(uname -r)

And press Enter.


Step Four:

It will ask you if you want to install the new updates (headers). Type Y for “yes” and press Enter again.


Step Five:

Once it has completely finished updating, and you’re presented with the [email protected] prefix again, type reboot in the terminal to restart Kali Linux.

The Kernel Headers have now been installed.

A video tutorial has also been created on this process. If you prefer video tutorials, please check it out here:


Thank you for following our tutorial!