Command to install linux headers fails

I need to install my linux headers for an Nvidia driver install. But I get an error when doing so:

[email protected]:~$ sudo apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-headers-2.6.32-5-amd64
E: Couldn't find any package by regex 'linux-headers-2.6.32-5-amd64'

How can I get this to work?

Edit: I am using Deb 6.

@Warren Young :

[email protected]:~$ sudo apt-get install -qy linux-headers-$(uname -r)
[sudo] password for peter: 
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package linux-headers-2.6.32-5-amd64
E: Couldn't find any package by regex 'linux-headers-2.6.32-5-amd64'

And also

[email protected]:~$ apt-cache search linux-headers
linux-headers-3.0.0-1-all - All header files for Linux 3.0.0 (meta-package)
linux-headers-3.0.0-1-all-amd64 - All header files for Linux 3.0.0 (meta-package)
linux-headers-3.0.0-1-amd64 - Header files for Linux 3.0.0-1-amd64
linux-headers-3.0.0-1-common - Common header files for Linux 3.0.0-1
linux-headers-3.0.0-1-common-rt - Common header files for Linux 3.0.0-1-rt
linux-headers-3.0.0-1-rt-amd64 - Header files for Linux 3.0.0-1-rt-amd64
linux-headers-2.6-amd64 - Header files for Linux amd64 configuration (dummy package)
linux-headers-2.6-rt-amd64 - Header files for Linux rt-amd64 configuration (dummy package)
linux-headers-amd64 - Header files for Linux amd64 configuration (meta-package)
linux-headers-rt-amd64 - Header files for Linux rt-amd64 configuration (meta-package)

And sources.list:

# Debian packages for testing
deb http://mirror.transact.net.au/debian/ testing main contrib non-free
# Uncomment the deb-src line if you want 'apt-get source'
# to work with most packages.
# deb-src http://mirror.transact.net.au/debian/ testing main contrib non-free

# Security updates for stable
# deb http://security.debian.org/ stable/updates main contrib non-free

Also note, I apt-get updated and this made no difference.

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Ubuntu doesn’t ship an AMD64-specific kernel header package.

What you probably want is linux-headers-2.6.32-5-generic. This combines Linux headers for both 32- and 64-bit Intel x86 CPU variants.

Say apt-cache search linux-headers to see your other choices.

Solution 2

Just type:

$ apt-cache search linux-headers

and choose any linux-headers like my choices:

linux-headers-3.14-kali1-amd64

And install it using this command:

$ sudo apt-get install linux-headers-3.14-kali1-amd64

It worked for me.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

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

Leave a Reply