Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 880
csnewb Avatar asked Mar 04 '14 07:03

csnewb


People also ask

Where are Linux headers located?

The system's libc headers are usually installed at the default location /usr/include and the kernel headers in subdirectories under that (most notably /usr/include/linux and /usr/include/asm).

Do I need Linux headers package?

You need the linux headers when you plan to develop and compile on the machine where you've installed Ubuntu. If you build an appliance dedicated to a specific task, you are certainly not willing to compile on it. If you need to compile your own application, you will do this on an different system.


4 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
like image 95
Abbas Gadhia Avatar answered Oct 23 '22 07:10

Abbas Gadhia


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.

like image 23
Lee Duhem Avatar answered Oct 23 '22 07:10

Lee Duhem


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 http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali 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

like image 2
Sam_ Avatar answered Oct 23 '22 08:10

Sam_


Check the Source.list file to contain the repository entries. You can find them at - https://docs.kali.org/general-use/kali-linux-sources-list-repositories. After editing the file, save it and run "apt-get update && apt-get upgrade". Now run "apt-get install linux-headers-$(uname -r)"

like image 1
ProBul Avatar answered Oct 23 '22 09:10

ProBul