Ubuntu 10 Nvidia Drivers Not Updated After Kernel Update Solution/How-To Manually Rebuild nvidia kernel modules for Ubuntu

I dread updating the kernel and rebooting to find the Ubuntu graphics aren't working and you have to manually intervene.   This is usually because Ubuntu for whatever reason didn't update the drivers you need (eg. the manually compiled Nvidia Kernel driver that MUST be recompiled for each and every kernel update unfortunately).

The most common reason may be that "linux-source" hasn't been installed automatically on my system.  I tried to manually reinstall the nvidia-driver hoping it would update the kernel-module (this is one thing I hate about Linux why can't we have a .dll style module that just works on ALL kernels like Windows without requiring an archaic recompile each time?)

You'll see below that it tells me when I tried to reinstall the nvidia kernel:

Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.

sudo apt-get --reinstall install nvidia-current
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages were automatically installed and are no longer required:
  python-tgext.admin uml-utilities python-openid python-ldap python-webob libjs-scriptaculous python-transaction python-beaker python-toscawidgets
  python-repoze.what python-decoratortools python-mysqldb python-turbojson python-turbogears2 python-zope.sqlalchemy libhtml-template-perl
  python-tg.devtools python-routes mysql-server-5.1 libopenjpeg2 python-sqlalchemy python-peak.util python-dev python-lxml python-nose libmysqlclient-dev
  socat python-webflash python-webhelpers python-catwalk python-pybabel python-beautifulsoup python-repoze.what-plugins python-genshi python-formencode
  python-scgi python-cheetah expect mysql-server python-repoze.who-plugins python-codespeak-lib python-pysqlite2 python-weberror python2.6-dev
  python-repoze.tm2 python-pylons python-turbogears2-doc python-tempita tcl8.5 python-repoze.who python-migrate python-sprox python-setuptools dnsmasq
  python-peak.rules python-pastescript libjs-prototype python-pygments python-decorator python-paste python-pastedeploy python-webtest python-xen-3.3
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 23.3MB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ca.archive.ubuntu.com/ubuntu/ lucid-updates/restricted nvidia-current 195.36.24-0ubuntu1~10.04.1 [23.3MB]
Fetched 23.3MB in 24s (942kB/s)                                                                                                                            
(Reading database ... 476658 files and directories currently installed.)
Preparing to replace nvidia-current 195.36.24-0ubuntu1~10.04.1 (using .../nvidia-current_195.36.24-0ubuntu1~10.04.1_i386.deb) ...
Removing all DKMS Modules
Done.
Unpacking replacement nvidia-current ...
Processing triggers for man-db ...
Setting up nvidia-current (195.36.24-0ubuntu1~10.04.1) ...
update-initramfs: deferring update (trigger activated)
update-initramfs: Generating /boot/initrd.img-2.6.32-38-generic-pae
Loading new nvidia-current-195.36.24 DKMS files...
Building only for 2.6.32-38-generic-pae
Building for architecture i686
Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.


Processing triggers for python-gmenu ...
Rebuilding /usr/share/applications/desktop.en_US.utf8.cache...
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.32-38-generic-pae
Processing triggers for python-support ...



The solution: Install the Linux Kernel Source + headers & Reinstall nvidia-current kernel module

 

sudo apt-get install linux-source linux-headers-`uname -r`; sudo apt-get --reinstall install nvidia-current

Unpacking replacement nvidia-current ...
Processing triggers for man-db ...
Setting up nvidia-current (195.36.24-0ubuntu1~10.04.1) ...
update-initramfs: deferring update (trigger activated)
update-initramfs: Generating /boot/initrd.img-2.6.32-38-generic-pae
Loading new nvidia-current-195.36.24 DKMS files...
Building only for 2.6.32-38-generic-pae
Building for architecture i686
Building initial module for 2.6.32-38-generic-pae
Done.

nvidia-current.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/2.6.32-38-generic-pae/updates/dkms/

depmod....

DKMS: install Completed.

Processing triggers for python-gmenu ...
Rebuilding /usr/share/applications/desktop.en_US.utf8.cache...
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.32-38-generic-pae
Processing triggers for python-support ...


Tags:

ubuntu, nvidia, drivers, updated, kernel, update, manually, rebuild, modules, ubuntui, dread, updating, rebooting, graphics, aren, intervene, didn, eg, compiled, recompiled, quot, linux, hasn, installed, automatically, reinstall, module, dll, kernels, requiring, archaic, recompile, ll, currently, skipped, sudo, apt, install, lists, dependency, packages, python, tgext, admin, uml, utilities, openid, ldap, webob, libjs, scriptaculous, transaction, beaker, toscawidgets, repoze, decoratortools, mysqldb, turbojson, turbogears, zope, sqlalchemy, libhtml, template, perl, tg, devtools, routes, mysql, server, libopenjpeg, peak, util, dev, lxml, libmysqlclient, socat, webflash, webhelpers, catwalk, pybabel, beautifulsoup, plugins, genshi, formencode, scgi, cheetah, codespeak, lib, pysqlite, weberror, tm, pylons, tempita, tcl, migrate, sprox, setuptools, dnsmasq, pastescript, prototype, pygments, decorator, pastedeploy, webtest, xen, autoremove, upgraded, newly, reinstalled, mb, archives, additional, disk, http, ca, archive, lucid, updates, restricted, fetched, kb, database, directories, preparing, current_, _i, deb, removing, dkms, unpacking, replacement, processing, triggers, db, initramfs, deferring, activated, generating, initrd, img, generic, pae, loading, architecture, gmenu, rebuilding, usr, applications, desktop, en_us, utf, cache, headers, uname, initial, ko, sanity, installation, installing, depmod, completed,

Latest Articles

  • Linux Ubuntu Cannot Print Large Images
  • Cannot Print PDF Solution and Howto Resize
  • Linux Console Login Screen TTY Change Message
  • Apache Cannot Start Listening Already on 0.0.0.0
  • MySQL Bash Query to pipe input directly without using heredoc trick
  • CentOS 6 and 7 / RHEL Persistent DHCP Solution
  • Debian Ubuntu Mint rc-local service startup error solution rc-local.service: Failed at step EXEC spawning /etc/rc.local: Exec format error
  • MySQL Cheatsheet Guide and Tutorial
  • bash script kill whois or other command that is running for too long
  • Linux tftp listens on all interfaces and IPs by DEFAULT Security Risk Hole Solution
  • python import docx error
  • Cisco Unified Communications Manager Express Cheatsheet CUCME CME
  • Linux Ubuntu Debian Missing privilege separation directory: /var/run/sshd
  • bash how to count the number of columns or words in a line
  • bash if statement how to test program output without assigning to variable
  • RTNETLINK answers: Network is unreachable
  • Centos 7 how to save iptables rules like Centos 6
  • nfs tuning maximum amount of connections
  • qemu-kvm error "Could not initialize SDL(No available video device) - exiting"
  • Centos 7 tftpd will not work with selinux enabled