This post is more of a note to myself on how to install the proprietary nVidia drivers on a fresh Debian install as I keep forgetting which packages I need!
After recently reinstalling Jessie onto a computer with an older Geforce card, I had to install an older version of the drivers (340.96).
From a fresh install, I needed to install the following packages:
# apt-get install gcc make linux-headers-3.16.0-4-amd64
The kernel version above will change as time goes on, so you can substitute the version number with $(uname -r) – e.g.
apt-get install linux-headers-$(uname -r)
Once the packages are installed, you need to make sure the gcc version that your kernel was compiled with matches your current compiler.
You can find out what version your kernel was compiled with by checking the contents of
# cat /proc/version
Linux version 3.16.0-4-amd64 (firstname.lastname@example.org) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.7-ckt20-1+deb8u4 (2016-02-29)
In my case, my kernel was compiled with gcc-4.8, so I had to also install gcc-4.8.
# apt-get install gcc-4.8
Once the compiler was installed, I also need to set the
CC environment variable so that the correct compiler is used to compile the nVidia driver.
# export CC=gcc-4.8
Now that everything is setup, I can run the nVidia installer to install the drivers.