Can’t install Linux Headers (Kali Linux)

I am trying to install Linux headers for Kali Linux on my machine and I have tried every possible solution on the internet but it always show “Unable to locate packages “

<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fd8f929289bd969c9194">[email protected]</a>:/usr/sbin# apt-get install linux-headers-4.6.0-kali1-amd64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-headers-4.6.0-kali1-amd64
E: Couldn't find any package by glob 'linux-headers-4.6.0-kali1-amd64'
E: Couldn't find any package by regex 'linux-headers-4.6.0-kali1-amd64'

Here is my sources.list file :

# Regular Repositories
deb http://http.kali.org/kali sana main non-free contrib
deb http://security.kali.org/kali-security sana/updates main contrib non-free
# Source repositories
deb-src http://http.kali.org/kali sana main non-free contrib
deb-src http://security.kali.org/kali-security sana/updates main contrib non-free

Uname -a output :

<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="72001d1d063219131e1b">[email protected]</a>:/usr/sbin# uname -a
Linux kali 4.6.0-kali1-amd64 #1 SMP Debian 4.6.4-1kali1 (2016-07-21) x86_64 GNU/Linux

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

The package linux-headers-4.6.0-kali1-amd64 is no longer available on the regularly kali-linux repository, it should be upgraded to the 4.8.x version.

update your /etc/apt/sources.list : see Kali sources.list Repositories

List the available linux-headers and linux-image through apt-cache search :

apt update 
apt-cache search linux-headers

Then install the correct package e,g ( this is an example , it depends on the previous output command) :

apt-get install linux-headers-4.8.0-kali1-amd64

also run;

apt-cache search linux-image

install it:

apt-get install linux-image-4.8.0-kali1-amd64

Reboot your system.

Or you can use the following command to upgrade you kernel to the latest available version and install the appropriate kernel headers:

apt update
apt dist-upgrade
reboot
apt install linux-headers-$(uname -r)

Method 2

So, due to lack of resources to support old system maintenance, most of the companies are moving on. So should you. Just download a new version of Kali Linux and avoid all these headaches. Besides, you have all the bugs patched and many issues solved. Unless you want to do some hacking and create alternatives to the repositories. Good luck.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x