How Install Debian 9 Stretch with Nvidia

With this Tutorial will you learn how Install Debian 9 Stretch with Nvidia.

If you already have Debian installed and you only want to install Nvidia, you can skip this step, but do not forget to remove everything that is Nvidia. You remove it with sudo apt-get remove --purge nvidia- * . To install Nvidia going to here.

Debian has several ISOs for installation, here speak only Two. I will only speak here how to install Debian Stretch with Hybrid Image File.

1) Netinst Image, The netinst CD here is a small CD image that contains just the core Debian installer code and a small core set of text-mode programs (known as "standard" in Debian). To install a desktop or other common software, you'll also need either an Internet connection or some other Debian CD/DVD images.

Download with Torrent und for CD and Prozessor 64Bit, Nestint.iso(309.3 MB) and Xfce-Desktop(670.0 MB)

found here .

2) Hybrid Image, Hybrid, because both has, live and installation. I think for new Debian users here is the best solution, here is the possibility to install different Desktop (GNOME, KDE, LXDE, Xfce, Cinnamon, and MATE), approximately every ISO has 2 GB capacity.

1. Download Debian Stretch 9

- You have to know which PCs have architecture (processor 64-bit or i364),

pc architecture

To show it here

- Download Direct (iso-hybrid) or with Torrent (bt-hybrid),

image download

To show it here

New! New! New! New! New!

Because Debian is to Buster Update, there is only to download Debian stretch Mate here on this link

2. Install your Image with DD command on a USB stick

I have to Download Mate Desktop, but working with all Desktop's similar.

Use of the dd tool can overwrite any partition of your machine. If you specify the wrong device in the instructions below, you could delete your primary Linux partition. Please be careful.

1-I will recommend your removing all USB device which connect to your Computer.

2- With the lsblk command show which devices are currently connected to your machine.

show which devices are currently connected

How the Image to show, my USB is sdb. Normality with lsblk the USB device will show sdb, sometime to come sdc because we have more USB device connected to the computer.

3- Now with dd create the bootable Debian installation media.

My image has on my Download Folder, and the name of the image File is debian-live-9.9.0-amd64-mate.iso

$ sudo dd if= of= bs=4M; sync

if= Here write the path to my folder where have my image Debian and the name from the image, /home/linux/Downloads/debian-live-9.9.0-amd64-mate.iso

of= Here write the path to my USB stick and his name, /dev/sdb

$ sudo dd if=/home/linux/Downloads/debian-live-9.9.0-amd64-mate.iso of=/dev/sdb bs=4M; sync

3. Install Debian Stretch 9

Here will install Debian as the only system operating. I explain the stepped more Important. If you have another operating system on your hard drive, Debian will tell you, when it reaches that point I tell you what to do.

1- Use the Graphical Debian Installer because for the new user more comfortable it is.

image debian installer

2- Give the computer's hostname, the hostname is the name assigned to a device on a network and is used to distinguish one device from another on a specific network or over the internet. As an example, my computer hostname is linuxusers, how to show it,

image write hostname

And you hit the key continue

3- Create a root pasword. (Write hin on a paper for not forget...)

image write root name

4- Create a user name. (Write hin on a paper for not forget...)

image write user name

5- Give the user a password. (Write hin on a paper for not forget...)

image write user password

6- The partitioning tool offers the choice of using an entire hard drive to create various partitions. For a (new) computer which will solely use Linux, this option is clearly the simplest, and you can choose the option, use entire disk. If you have another operating system, it will detect it and ask you if you want to have it next to the other, answer yes.

image options for partiton

7- The firs method is called All files in one partition. The entire Linus system is stored in a single filesystem, this is the best method for new Linux user.

image options for save partition

8- Asked to confirm the partition changes, When the configuration from your partition is how you want, click Finish partitioning and write changes to the disk

image confirm partition change

9 - Asked if you wish to write this change to disk.

image second confirmation partition change

Start to install the packet, length 5 minutes.

10- Asked if you wish to use a network mirror, a mirror is a copy of programs available for download. If you find convenient to one of the mirror sites listed, you might choose the mirror site as your primary source of downloads, so you get better response times.

image asked if you will a network mirror

11- Asked from which Country you will need the mirror.

image asked from which country the network mirror

12- Asked from which region you will need the mirror.

image asked from which region the network mirror

13- Install the GRUB boot loader.

image asked if will install grub

14- Install the GRUB boot loader on the hard disk. Typically installed on the first hard disk. /dev/sda .

image asked if where install grub

When have another Linux installed on this hard disk.

Here I will explain with an example:

I have Mint Linux or Ubuntu on a hard disk and also wants to install Debian, the GRUB from Linux Mint or Ubuntu is installs on /dev/sda. I give two options where install the GRUB on Debian.

You can install grub to /dev/sda overwriting your Linux Mint's or Ubuntu's bootloader. The Debian installer's grub should detect your existing Linux Mint or Ubuntu installation and add a boot entry for it.

You skip the grub installation in the Debian installer and boot into Linux Mint or Ubuntu when your installation is complete. Open a terminal and update grub with sudo update-grub manually. Grub should find your Debian installation and add a boot entry to your /boot/grub/grub.cfg .

15- The installation is now complete, the program invites you to remove the installation media and to restart the computer.

image asked to remove the installation media

click the buttom continue to reboot it.

4. Update your new Debian and install Nvidia

1- Log in with your username and password

image login window

2- Debian comes without adding the user to the group sudo

Now does it, become superuser with,

su -

Give your root password

Add you usarname to sudo

#adduser my_username sudo

How to show it

image asked to remove the installation media

You must reboot your Computer for the change to take effect.

3- We have two possibilities to install Nvidia components

1) Because of Nvidia drivers package in Debian is proprietary, Debian offers the proprietary NVIDIA drivers in the non-free repository you need the contrib and non-free components.

Add contrib non-free ,

software-properties-common provides an abstraction of the used apt repositories. It allows you to easily manage your distribution and independent software vendor software sources.

non-free is for packages which are straight-up not free. The only requirement is that they are redistributable. The Debian project considers that non-free is not a part of Debian, and is only provided as a convenience for users.

contrib is for packages which are themselves free but depend on packages that are in non-free. It's also not considered a part of Debian.

Now with commands

sudo apt install software-properties-common

sudo add-apt-repository non-free

sudo add-apt-repository contrib

sudo apt-get update

sudo apt update && apt full-upgrade

# reboot your computer

sudo reboot now

2) Or add contrib non-free components how here to say.

You must remove all from sources.list , it should blank to say

With sudo nano /etc/apt/sources.list add the new sources,

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

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

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

With them keyboard's Crtl + X asked us if we will save them, we answer with y and we give the key ↵ enter.

Update Debian

sudo apt-get update

sudo apt-get dist-upgrade

sudo reboot now

4- Install Nvidia

We have two possibilities to install Nvidia;


Directly from the Debian repositories with;

sudo apt-get update

sudo apt-get -f install nvidia-driver

sudo reboot now


Install with backports;

You are running Debian stable because you prefer the stable Debian tree. It runs great, there is just one problem: The software is a little bit outdated compared to other distributions. That is where backports come in.

Now on the terminal, add stretch-backports to repository

sudo add-apt-repository 'deb stretch-backports main contrib non-free'

sudo apt-get update

Install Nvidia

sudo apt-get -t stretch-backports install nvidia-driver

Reboot your Computer.

sudo reboot now

5- Check if Nvidia is install

The NVIDIA graphics processing unit (GPU) series/codename of an installed video card can usually be identified using the lspci command. For example:

$ lspci -nn | egrep -i "3d|display|vga"

03:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Device [1022:43d0] (rev 01) 26:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1)

or install lshw

Install lshw

sudo apt-get install lshw.

check to Nvidia

sudo lshw -c display

How to see it

linux@linususers~$ sudo lshw -c display
description: VGA compatible controller
product: GP106 [GeForce GTX 1060 6GB]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:26:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
configuration: driver=nvidia latency=0
resources: irq:75 memory:f6000000-f6ffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:e000(size=128) memory:c0000-dffff

You comment is welcome: