Categories: LinuxNews

[Solved] Unable to locate package linux-headers | How to Install Kali 2020 Headers | Install Virtual Box

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

E: Unable to locate package linux-headers-5.4.0-kali2-amd64
E: Couldn’t find any package by glob ‘linux-headers-5.4.0-kali2-amd64’
E: Couldn’t find any package by regex ‘linux-headers-5.4.0-kali2-amd64’

After days of googling, I found a solution for installing the linux-headers

The Problems I Faced

What I was trying to do was, trying to install virtual box. Every time I install virtualbox and start virtualbox service, I always ended up with an error. After further troubleshooting, I found that the real issue was with my linux headers. During dependency check, if missing, installer will prompt that kernel headers should be installed.

The Usual Method (Didn’t work for most of us)

Add the correct repositories from Here. Then run this commands in the terminal[AdSense-C]
apt update -y && apt upgrade -y && apt dist-upgrade
After that, reboot the system, open up the terminal and run
sudo apt-get install linux-headers-$(uname -r)
By running that command, it is supposed to install the linux kernel headers but in Kali 2018, it is not working.

So Here is How I Did It

Step 1

Add Kali Linux Repo to /etc/apt/sources.list
Then run this commands in the terminal
apt update -y && apt upgrade -y && apt dist-upgrade
Reboot after successful completion

Step 2

After rebooting, open up the terminal and execute the command
uname -r
It will show you the current version

Step 3

Now Download the required header files and install it using the command
dpkg -i packagename.deb
Commonly used header files are provided below.
If these aren’t the right version, follow the below links to get all versions of header files available.[AdSense-A]

http://mirror.internode.on.net/pub/kali/pool/main/l/linux/

Select one and download and install it manually and then you will be able to run virtualbox without any issue.
[AdSense-B]
Jithin Sanal

View Comments

  • I have Kernel 4.15.0-kali2-amd64. I have downloaded the header file for this kernel. But when I'm trying to install it I'm getting below error
    "
    dpkg: error processing archive efi-modules-4.15.0-kali2-amd64-di_4.15.11-1kali1_amd64.udeb (--install):
    trying to overwrite '/lib/modules/4.15.0-kali2-amd64/kernel/drivers/firmware/efi/efivars.ko', which is also in package linux-image-4.15.0-kali2-amd64 4.15.11-1kali1
    Errors were encountered while processing:
    efi-modules-4.15.0-kali2-amd64-di_4.15.11-1kali1_amd64.udeb
    "

    If anyone have any solution for this please assist. I'm trying to configure it since last 4 days but not working for me.
    Thanks in advance.

Recent Posts

Transform Your Trash into Treasure: 10 Genius Ways to Reuse Old Electronics!

Discover creative ways to recycle old electronics into new, useful gadgets. Turn your electronic waste…

2 weeks ago

Not Just for Lights – Top 10 LED Projects That Will Shock You!

Explore the top 10 advanced LED projects that go beyond basic lighting. Perfect for electronics…

2 weeks ago

Revolutionizing PCB Fabrication: How UV Resin is Redefining the Art of Circuit Board Design

The integration of UV resin into the PCB production process represents a great achievement and…

1 month ago

Unlock the Secrets to Thriving in Electronics Engineering: A Must-Read Guide for Aspiring Engineers

Discover essential tips for electronics engineering graduates to gain practical experience, from internships to DIY…

2 months ago

Beginners Beware: Must-Have Electronics Tools for Beginners in 2024

Learn essential tips on setting up your workspace, choosing the right tools, and starting your…

2 months ago

2024 Electronics: Top Electronics Trends and Innovations

The electronics sector is about to undergo a revolutionary period that will be characterized by…

3 months ago