Installing kernel headers packages missing error

2.4k views Asked by At

I am trying to install kernel-headers but getting this error

E: Unable to locate package linux-headers-5.9.0-kali1-amd64

E: Couldn't find any package by glob 'linux-headers-5.9.0-kali1-amd64'

E: Couldn't find any package by regex 'linux-headers-5.9.0-kali1-amd64'

I have updated and uncommented this line in sources.list

deb-src http://http.kali.org/kali kali-rolling main contrib non-free

but errors thats can't locate regex or glob. what I am missing?

2

There are 2 answers

0
geek On

from what am guessing linux-headers-5.9.0 is not available in the kali repository.

you can always use apt-cache search linux-headers to know if it available but to update to the latest linux headers

sudo apt-get update

sudo apt-get dist-upgrade

then search for Linux-headers available using apt search Linux-headers.

so you install the latest version using

sudo apt-get install -y linux-headers-$(uname -r)
1
germangti On

Here's what you may need to do

sudo apt-get update # This will update the repositories list
sudo apt-get upgrade # This will update all the necessary packages on your system
sudo apt-get dist-upgrade # This will add/remove any needed packages
reboot # You may need this since sometimes after a upgrade/dist-upgrade, there are some left over entries that get fixed after a reboot
sudo apt-get install linux-headers-$(uname -r) # This should work now