Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Every time there's a kernel update, nvidia graphics drivers stops working because there's not a valid kernel module.

What is the ubuntu way to 'recompile' the nvidia module for the new kernel?

Shouldn't it be done automatically? I am suffering a bug?

share|improve this question
up vote 4 down vote accepted

If you have installed the NVIDIA driver as an ubuntu package, it should be updated automatically after each kernel upgrade.

You can install the packaged driver using the Additional Drivers tool in the dashboard, or installing the package nvidia-current.

If you have installed the nvidia driver directly from their website it is probably sensible to remove it before installing this package - I'm not certain how good it will be at detecting the conflict.

If you have installed the package from the ubuntu repositories, you can try reconfiguring it with dpkg-reconfigure but I suspect building the nvidia module is triggered by installing a new kernel, and I'm not sure how to trigger this otherwise. The traditional uninstall and re-install might well work (sudo apt-get remove nvidia-current; sudo apt-get install nvidia-current).

share|improve this answer
I installed the nvidia driver through an Ubuntu package. But updating the kernel didnt trigger the recompilation of my nvidia module. Thanks for your tips anyway. – fazineroso Aug 9 '12 at 12:04

Please note that neither installing a kernel upgrade nor drivers from officially unsupported repositories is recommended! Follow these instructions at your own risk and only if you know what you're doing!

If you installed an kernel that's ahead of current official Ubuntu repositories (e.g. kernel 3.4 or 3.5) you might not succeed with simply reinstalling nvidia drivers.

The only way I found so far to get nvidia-drivers to work again is by adding the following ppa to your repositories. In a terminal type:

sudo add-apt-repository ppa:xorg-edgers/ppa

After that, do a sudo apt-get update and sudo apt-get install nvidia-current.

That should do the trick. If not, run an additional sudo apt-get upgrade.

share|improve this answer

If you want to rebuild the kernel modules only, then you might just want to execute

sudo apt-get install --reinstall nvidia-current

if you have nvidia-current installed, or if you have nvidia-331 installed then this should do the work:

sudo apt-get install --reinstall nvidia-331

no need to add a repo or install new software :-)

share|improve this answer
I spend most of my time in sudo shell so forgot to mention it, thanks for reminding :-) – Steel Brain Aug 17 '14 at 22:05

For me dpkg-reconfigure rebuilds the Nvidia driver with the latest kernel. This then requires a reboot to take effect. My example below uses the older nvidia-304-updates.

sudo dpkg-reconfigure nvidia-304-updates

EDIT: I managed to automate this by writing a script zz-dkpg-reconfigure-nvidia that runs after kernel updates

# Reconfigure nvidia driver


dpkg-reconfigure $DRIVER > /var/log/dpkg-reconfigure-nvidia.log 2>&1

exit 0

I installed the above script by running

sudo install zz-dkpg-reconfigure-nvidia /etc/kernel/postinst.d

Works on my Ubuntu 14.04 kernel 3.13.0-29 to 3.13.0-36 update.

share|improve this answer

Your Answer


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.