Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

peter@peter-deb:~$ 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 :

peter@peter-deb:~$ 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

peter@peter-deb:~$ 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.

share|improve this question
    
Depending on the distribution, there may be a virtual package called linux-headers-virtual. I know it exists in the latest Ubuntu and its derivatives. –  Sean C. Sep 1 '11 at 12:27
    
This seems the name of a Debian package. Have you mixed Ubuntu and Debian repositories? –  enzotib Sep 1 '11 at 12:33
1  
@Sean C.: the package you talk about is for virtual machines, you mean linux-headers-generic I suppose, that always depends on the latest headers. But latest kernel is not necessarily the one you boot from. –  enzotib Sep 1 '11 at 12:42
    
@enzotib: Yes. It does install the headers for the most current kernel and, yes, it is for virtual machines. I assumed, incorrectly, that it meant it was a "virtual" package as Debian and its derivatives use virtual packages to refer to a group of packages that are installed when you select the single virtual package. –  Sean C. Sep 1 '11 at 12:52
    
I am using Debian 6. –  ptrcao Sep 1 '11 at 18:40

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer
    
I am using Debian 6 - does the same apply? –  ptrcao Sep 1 '11 at 18:39
1  
No, it doesn't. I just tried your command on a freshly-installed Debian 6 AMD64 system, and it works. My best guess is that you have a problem with your selected Debian mirrors. Please append the output of sudo apt-get install -qy linux-headers-$(uname -r) to your message above. –  Warren Young Sep 1 '11 at 22:02
    
See above. What now? –  ptrcao Sep 2 '11 at 12:23
    
Try the apt-cache command above. I expect you'll see that there is no -amd64 package listed. If so, a sudo apt-get update may fix it. If not, the set of mirrors you've selected doesn't have the package, for whatever reason. –  Warren Young Sep 2 '11 at 12:58
1  
I think your problem is that you installed from stable, then switched to testing. As you can see, the testing tree is shipping newer kernels than the 2.6.32-5 you're running on now. Either switch back to stable, or upgrade your kernel so you can use headers from the testing tree. You'd want to check that this nVidia driver works with the newer kernels first, of course. –  Warren Young Sep 2 '11 at 13:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.