Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

nvidia driver doesn't work (couldn't install kernel headers)

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
jcarpenter2
Posts: 5
Joined: 2017-07-08 19:47

nvidia driver doesn't work (couldn't install kernel headers)

#1 Post by jcarpenter2 »

Hey,

I just tried to install nvidia-driver as described here: https://wiki.debian.org/NvidiaGraphicsD ... ary_Driver

After installing nvidia-driver and rebooting, nvidia-settings says "You do not appear to be running the NVIDIA X driver." and asks me to run nvidia-xconfig. Funnily enough, nvidia-xconfig produces an unusable xorg.conf file. Furthermore, when I run modprobe nvidia I get the following output:

Code: Select all

root@foldingmachine:/home/lol/Downloads# modprobe nvidia
modprobe: FATAL: Module nvidia-current not found in directory /lib/modules/4.9.0-3-amd64
modprobe: ERROR: ../libkmod/libkmod-module.c:979 command_do() Error running install command for nvidia
modprobe: ERROR: could not insert 'nvidia': Operation not permitted
Importantly, I was unable to install kernel headers (although the nvidia-driver package did not complain about this). Here was the error:

Code: Select all

root@foldingmachine:/home/lol/Downloads# apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 linux-headers-amd64 : Depends: linux-headers-4.9.0-3-amd64 but it is not installable
E: Unable to correct problems, you have held broken packages.
And when I manually added the dependency that was mentioned in the above console output trying to install kernel headers, I got a different error:

Code: Select all

root@foldingmachine:/home/lol/Downloads# apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') linux-headers-4.9.0-3-amd64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package linux-headers-4.9.0-3-amd64 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'linux-headers-4.9.0-3-amd64' has no installation candidate
What should I check next? How do I install kernel headers so that the nvidia module can be compiled for my current kernel?

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: nvidia driver doesn't work (couldn't install kernel head

#2 Post by stevepusser »

This almost always means something is wrong with your software sources list, usually because of some choice during installation.

What's the output of

Code: Select all

cat /etc/apt/sources/list
MX Linux packager and developer

jcarpenter2
Posts: 5
Joined: 2017-07-08 19:47

Re: nvidia driver doesn't work (couldn't install kernel head

#3 Post by jcarpenter2 »

Code: Select all

root@foldingmachine:/home/lol/Downloads# cat /etc/apt/sources.list
# 

# deb cdrom:[Debian GNU/Linux testing _Buster_ - Official Snapshot amd64 NETINST 20170626-04:23]/ buster main

#deb cdrom:[Debian GNU/Linux testing _Buster_ - Official Snapshot amd64 NETINST 20170626-04:23]/ buster main

deb http://ftp.us.debian.org/debian/ buster main contrib non-free
deb-src http://ftp.us.debian.org/debian/ buster main contrib non-free

deb http://security.debian.org/debian-security buster/updates main
deb-src http://security.debian.org/debian-security buster/updates main
(I added contrib and non-free after installing debian, and ran apt update before trying to install kernel headers and nvidia-driver.)

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: nvidia driver doesn't work (couldn't install kernel head

#4 Post by dilberts_left_nut »

linux-headers-4.9.0-3-amd64 is not currently available in testing (and likely never will be).
AdrianTM wrote:There's no hacker in my grandma...

jcarpenter2
Posts: 5
Joined: 2017-07-08 19:47

Re: nvidia driver doesn't work (couldn't install kernel head

#5 Post by jcarpenter2 »

I had nvidia drivers working perfectly fine through the nvidia-driver package just yesterday. Today I reinstalled Debian, and it is broken.
dilberts_left_nut wrote:linux-headers-4.9.0-3-amd64 is not currently available in testing (and likely never will be).
Why is that? Surely there's a way to install linux headers in testing.

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: nvidia driver doesn't work (couldn't install kernel head

#6 Post by sunrat »

Current kernel in buster is 4.11. dist-upgrade will pull that in, then you will be able to install headers.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

jcarpenter2
Posts: 5
Joined: 2017-07-08 19:47

Re: nvidia driver doesn't work (couldn't install kernel head

#7 Post by jcarpenter2 »

sunrat wrote:Current kernel in buster is 4.11. dist-upgrade will pull that in, then you will be able to install headers.
Can you walk me through the process in a little more detail? I ran apt update followed by apt dist-upgrade, but am still on kernel 4.9.0-3 according to apt list --installed | grep linux-image.

Code: Select all

root@foldingmachine:/home/lol/Downloads# apt update
Hit:1 http://ftp.us.debian.org/debian buster InRelease
Hit:2 http://security.debian.org/debian-security buster/updates InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
root@foldingmachine:/home/lol/Downloads# apt dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@foldingmachine:/home/lol/Downloads# apt list --installed | grep linux-image
 
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

linux-image-4.9.0-3-amd64/testing,now 4.9.30-2 amd64 [installed,automatic]
linux-image-amd64/testing,now 4.9+80 amd64 [installed]

(I seem to be able to install linux-image-4.11.0-1-amd64 manually, but I imagine doing an upgrade through apt would be the safer / cleaner way.)

Code: Select all

root@foldingmachine:/home/lol/Downloads# apt install linux-image-4.11.0-1-amd64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  firmware-linux-free irqbalance
Suggested packages:
  linux-doc-4.11 debian-kernel-handbook
The following NEW packages will be installed:
  firmware-linux-free irqbalance linux-image-4.11.0-1-amd64
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 39.4 MB of archives.
After this operation, 191 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: nvidia driver doesn't work (couldn't install kernel head

#8 Post by sunrat »

jcarpenter2 wrote:(I seem to be able to install linux-image-4.11.0-1-amd64 manually, but I imagine doing an upgrade through apt would be the safer / cleaner way.)
Installing it with apt is also a clean/safe way.
Usually the kernel meta-package linux-image-amd64 will depend on the latest available kernel so automatically install when you dist-upgrade. For some reason the meta-package currently still depends on linux-image-4.9.0-3-amd64, so manual install is the only option atm.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: nvidia driver doesn't work (couldn't install kernel head

#9 Post by dilberts_left_nut »

jcarpenter2 wrote:Can you walk me through the process in a little more detail?
Don't take this the wrong way, but if you want a system that just works, without missing/broken packages, and lots of maintenance (which you will need to learn about), you should probably be running stable.
For the next year or so, testing is going to get worse, not better.

https://www.debian.org/doc/manuals/debi ... l_upgrades
AdrianTM wrote:There's no hacker in my grandma...

jcarpenter2
Posts: 5
Joined: 2017-07-08 19:47

Re: nvidia driver doesn't work (couldn't install kernel head

#10 Post by jcarpenter2 »

sunrat wrote:
jcarpenter2 wrote:(I seem to be able to install linux-image-4.11.0-1-amd64 manually, but I imagine doing an upgrade through apt would be the safer / cleaner way.)
Installing it with apt is also a clean/safe way.
Usually the kernel meta-package linux-image-amd64 will depend on the latest available kernel so automatically install when you dist-upgrade. For some reason the meta-package currently still depends on linux-image-4.9.0-3-amd64, so manual install is the only option atm.
Success, I installed linux-image-4.11.0-1-amd64, followed by linux-headers-4.11.0-1-amd64, then rebooted and the nvidia drivers are now working.
dilberts_left_nut wrote:
jcarpenter2 wrote:Can you walk me through the process in a little more detail?
Don't take this the wrong way, but if you want a system that just works, without missing/broken packages, and lots of maintenance (which you will need to learn about), you should probably be running stable.
For the next year or so, testing is going to get worse, not better.

https://www.debian.org/doc/manuals/debi ... l_upgrades
Thanks for the advice, I'll do that.

Post Reply