Saturday, 26 November 2011

Problems with Nvidia on update to kernel 3.1.0-1

I recently came into some problems which gave me a great deal of hassle whilst updating to Linux Kernel 3.1.0-1, I have a 64 Bit System and source my software from the Debian Testing repositories.

On what should have been a fairly routine update, I restarted my system later in the day to find myself dropped into a command line with a message stating that X server had failed. Running the command nvidia-xconfig would produce a new xorg.conf file, but I would still receive the same error message about the nvidia module being unknown.

I spent a few hours trawling the forums on the net and they all pointed to a rebuild of dkms, however putting in the command sudo dpkg-reconfigure nvidia-kernel-dkms, left me with the error message
Module build for the currently running kernel was skipped since the kernel source for this kernel does not seem to be installed.
This left me scratching my head and very frustrated as I knew that the kernel source was installed. Finally I started looking at the installed components and noticed that the kernel headers did not match the kernel source number, my kernel source was 3.1.0-1, whilst the installed headers were linux-headers-3.0.0-1-common and linux-headers-3.0.0-1-amd64, a miss match.

  1. I simply ran the command: sudo apt-get install linux-headers-3.1.0-1-common linux-headers-3.1.0-1-amd64
  2. then I followed it with: sudo dpkg-reconfigure nvidia-kernel-dkms
and viola, upon restart I was back in my graphical environment. This, of course, will not solve every bodies problems, however this is the simple fix that worked for me, but it took me a long time to find it. Hopefully this will spare some people a few hours of pain and frustration.