I am trying to install the legacy nvidia 304 drivers on my old Latitude D820, which has a GeForce Go 7300, but the installer fails saying : Failed to build the NVIDIA kernel module .

Here is the output of /var/log/nvidia-installer.log.

I have installed build-essential and my kernel's headers.

Thank you for your help!

3 Answers 3


On Debian, the recommended approach if you want to install the proprietary NVIDIA drivers is to enable the contrib and non-free repositories and install the packaged driver. Adapting the instructions for Debian 8 (do everything as root or via sudo):

  • add contrib non-free to the appropriate line in /etc/apt/sources.list, so you end up with something like

    deb http://httpredir.debian.org/debian/ testing main contrib non-free
  • install the kernel headers (which you already have) and the driver's kernel module

    aptitude update
    aptitude -r install linux-headers-$(uname -r) nvidia-legacy-304xx-kernel-dkms
  • install and run nvidia-xconfig to generate the appropriate configuration file

    aptitude install nvidia-xconfig

Doing all this should also install nvidia-installer-cleanup which will clean the remnants of NVIDIA's installer.

After doing all this, reboot and the new driver should be built (if it hasn't already been built) and loaded.

If you want to avoid installing other non-free packages, see How to block non-free with apt preferences?


Won't work like this in Stretch. My card depends upon the 304xx-legacy driver, too, as detected by nvidia-detect but the whole package plus dependencies is NOT available in ANY of the debian Stretch repositories. So nvidia-detect failed as well, told me nonsense to install, got me to a pitch black screen, had to remove all nvidia packages. Manual install of the deb package failed as well, again due to about six missing dependencies in Stretch. There is a 304xx-package in Sid/experimental but I didn't want to mess around in my sources.list, ending up in a mixed and confused system. Switched to free nouveau driver, having to live with kernel stating "pointer to flat panel table invalid" but graphics all working.


Here is what worked for me after a fresh install of Debian stretch RC2 (I have just the base system with KDE):

  1. Boot up grub with nomodeset option: https://askubuntu.com/questions/38780/how-do-i-set-nomodeset-after-ive-already-installed-ubuntu

  2. Add contrib and non-free in Software Center (do not use Software Management in further steps as it might mess up with dependencies).

  3. Install any updates.

  4. Install Synaptic Package Manager from Software Center.

  5. From Synaptic Package Manager install aptitude.

  6. Open a root terminal and follow instructions for installig nvidia legacy driver in Debian Jessie for your case (mine was the 304xx driver): https://wiki.debian.org/NvidiaGraphicsDrivers#NVIDIA_Proprietary_Driver

  7. Restart.

I restarted my system without creating new Xorg server configuration file.

You must log in to answer this question.