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

Kernels & Hardware, configuring network, installing services

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

Postby jcarpenter2 » 2017-07-08 20:01

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?
jcarpenter2
 
Posts: 5
Joined: 2017-07-08 19:47

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

Postby stevepusser » 2017-07-08 20:28

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
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Krita 3.3.2.1, Pale Moon 27.6.0, Audacity 2.2.0, mpv 0.27.0, Corebird 1.7.1, Firefox 57.0, SMPlayer 17.11.2
User avatar
stevepusser
 
Posts: 8900
Joined: 2009-10-06 05:53

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

Postby jcarpenter2 » 2017-07-08 21:20

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.)
jcarpenter2
 
Posts: 5
Joined: 2017-07-08 19:47

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

Postby dilberts_left_nut » 2017-07-08 22:46

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...
User avatar
dilberts_left_nut
 
Posts: 4687
Joined: 2009-10-05 07:54
Location: enzed

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

Postby jcarpenter2 » 2017-07-08 23:13

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.
jcarpenter2
 
Posts: 5
Joined: 2017-07-08 19:47

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

Postby sunrat » 2017-07-08 23:55

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!
User avatar
sunrat
 
Posts: 2035
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

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

Postby jcarpenter2 » 2017-07-09 00:17

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.
jcarpenter2
 
Posts: 5
Joined: 2017-07-08 19:47

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

Postby sunrat » 2017-07-09 00:35

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
sunrat
 
Posts: 2035
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

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

Postby dilberts_left_nut » 2017-07-09 00:45

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...
User avatar
dilberts_left_nut
 
Posts: 4687
Joined: 2009-10-05 07:54
Location: enzed

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

Postby jcarpenter2 » 2017-07-09 03:55

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.
jcarpenter2
 
Posts: 5
Joined: 2017-07-08 19:47


Return to System configuration

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable