Install Linux-Headers on Debian Unable to Locate Package

I am trying to install the linux-headers for my Kernel Version 3.4.61+ and Debian Version 7.1

I typed this Commands:

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

On the last command I always get an Error:

E: Unable to locate package linux-headers-3.4.61
E: Couldn't find any package by regex 'linux-headers-3.4.61'

btw: It´s all based on a Cubietruck/Cubieboard3

9

5 Answers

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
6

You could search first, then choose the closest one.

For example, on my system:

$ apt-cache search linux-headers
linux-headers-3.2.0-4-all - All header files for Linux 3.2 (meta-package)
linux-headers-3.2.0-4-all-amd64 - All header files for Linux 3.2 (meta-package)
linux-headers-3.2.0-4-amd64 - Header files for Linux 3.2.0-4-amd64

So I can install any one of these three.

1

Heres my experience with this problem:

I installed Kali Linux from a live memory stick. Whilst installing I didn't have an internet connection.

This meant that my sources.list file was set to "Default Off-line Install Values". This meant that when installing I was limited to just the packages and data from the memory stick I Initially installed from.

To fix this, you need to change your sources.list (called switching branches):

Open terminal:

nano /etc/apt/sources.list

This opens the sources file

Now at the top of the file paste in the following two lines:

deb  kali-rolling main non-free contrib
deb-src  kali-rolling main non-free contrib

Press CTRL + X then Press Y and Enter to save the file.

Now you can type the following commands to update Kali:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
reboot

And finally, you should now be able to...

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

This is just my unique experience with this error stemming from an offline install. I hope this helps someone else out there.

Reference

Check the Source.list file to contain the repository entries. You can find them at - . After editing the file, save it and run "apt-get update && apt-get upgrade". Now run "apt-get install linux-headers-$(uname -r)"

For latest version of kali linux do the following to install vbox guest additions.

  1. Update the packages

    # apt-get update
    
  2. Command to install virtualbox guest additions

    # apt-get install -y virtualbox-guest-x11
    
  3. Reboot

    # reboot
    
  4. Enjoy!

Now you have successfully installed guest OS additions and you can verify that by toggling full-screen it should now stretch to your screen resolution.

Source: Kali Linux Official (Docs - VirtualBox guest additions)

Your Answer

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

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest