In this tutorial I will show you how to properly install nvidia drivers on debian 9 or ubuntu 17.04 system.
Note: If you are using ubuntu you can skip directly to Install nvidia-detect step .

Add “contrib” and “non-free” repository – (You can skip this step if you are using ubuntu)

open sources.list file
nano /etc/apt/sources.list

append ‘contrib’ and ‘non-free’ to repo URL

deb stretch main contrib non-free
deb-src stretch main

deb stretch-updates main contrib non-free
deb-src stretch-updates main

deb stretch/updates main contrib non-free
deb-src stretch/updates main

Update apt cache

sudo apt-get update

Install nvidia-detect

sudo apt-get install nvidia-detect

now execute


nvidia-detect command is used to find the right nvidia driver for your gpu.

Detected NVIDIA GPUs:
00:0d.0 VGA compatible controller [0300]: NVIDIA Corporation C61 [GeForce 7025 / nForce 630a] [10de:03d6] (rev a2)

Checking card:  NVIDIA Corporation C61 [GeForce 7025 / nForce 630a] (rev a2)
Your card is only supported up to the 304 legacy drivers series.
It is recommended to install the

Here nvidia-legacy-304xx-driver is the right driver package for my gpu

Install the recommended driver and linux headers

sudo apt-get install linux-headers-$(uname -r) nvidia-legacy-304xx-driver 

Create an Xorg configuration for your gpu

mkdir /etc/X11/xorg.conf.d
nano /etc/X11/xorg.conf.d/20-nvidia.conf 

Now add below contents to the file

Section "Device"
Identifier "My GPU"
Driver "nvidia"

Reboot to take effect new driver.

Categories: Tutorials

shyam jos

My name is Shyam Jos, I am a passionate Linux system administrator from Kochi, India. I am a strong advocate of using Linux and Open-Source software.


J Hanley · July 28, 2018 at 10:16 AM

Thanks! Worked really well.

Mostafa · September 5, 2018 at 1:20 AM

Thanks Bro,

DJ · December 9, 2019 at 6:35 AM

Thank you, I was struggling trying to load the *.run file for the Nvidia driver which simply did not work (hours go by…). Your tutorial solved all issues, thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.