Debian 9 (stretch) update kernel & Nvidia drivers

Updating kernel of Debian 9 (stretch) and Nvidia drivers to solve freeze of NVIDIA video adapter

Why to update the kernel?

After several years of using Debian 8 (jessie) I decided to upgrade the system to Debian 9 (stretch).

The distribution upgrade went well as described in many of good articles, and ended with useless system.

So it was necessary to perform a clean installation of new system. Since I have a separate partition dedicated to /home directory it was easy to install and almost all settings for different software didn’t changed.

After moving the cache of browsers to tmpfs, as you can read in that article LINK, and playing with Tweak Tool for pleasant interface, I got a working system.

But, here is reason of this article, the system become freeze each time I used the nice Vivaldi browser with many of open web pages each in it’s own tab. Suspicions was on drivers for video adapter which is “NVIDIA Corporation GK107GL [Quadro K2000] (rev a1)”.

Investigation of /var/log/kern.log showed a problem with that driver:

Thoughts about installation of native NVIDIA drivers came to my mind and here is a nice article about it: “How to install Steam and Nvidia drivers on Debian Jessie” thanks to Eike Sauer.

But updating the kernel to new version fixed the problem.

Below are instructions for kernel update.

Update the list of sources

Add to apt sources the support for non free and backports packages as following:

You can use the in the /etc/apt/sources.list file:

# deb cdrom:[Debian GNU/Linux 9.2.1 _Stretch_ - Official amd64 NETINST 20171013-13:07]/ stretch main
# deb cdrom:[Debian GNU/Linux 9.2.1 _Stretch_ - Official amd64 NETINST 20171013-13:07]/ stretch main

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

deb stretch/updates main
deb-src stretch/updates main

# stretch-updates, previously known as 'volatile'
deb stretch-updates main contrib non-free
deb-src stretch-updates main contrib non-free

deb stretch-backports main contrib non-free

The updating of apt repositories is necessary:

sudo apt update
sudo apt upgrade

Look for the desired kernel image

sudo apt-cache search linux-image

In my case the interesting packages was:

linux-headers-4.13.0-0.bpo.1-amd64 - Header files for Linux 4.13.0-0.bpo.1-amd64
linux-image-4.13.0-0.bpo.1-amd64 - Linux 4.13 for 64-bit PCs

Installation of two kernel related packages:

sudo apt install linux-image-4.13.0-0.bpo.1-amd64 linux-headers-4.13.0-0.bpo.1-amd64

uname -a
Linux lab 4.13.0-0.bpo.1-amd64 #1 SMP Debian 4.13.4-2~bpo9+1 (2017-10-17) x86_64 GNU/Linux

The system is stable and didn’t suffered from crashes at least till time of writing this article.

Update (15-11-2017):

System freeze, not so often like with previous kernel, but freeze.

Updated the Nvidia driver not to default proprietary 340xx version but to one from the backports 375.82 (Jul 2017).

Since the stretch-backports repository is configured, what is necessary, to install the backport driver such as:

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

No freezes!

tmpfs as cache location for internet browsers

Linux administration

How set the tmpfs under Linux Debian


# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
# <file system> <mount point> <type> <options> <dump> <pass>

tmpfs /tmp tmpfs defaults,noatime,mode=1777,size=20G 0 0
tmpfs /var/web-cache/vivaldi/username tmpfs defaults,noatime,uid=username,gid=usergroup,nosuid,size=500M 0 0
tmpfs /var/web-cache/firefox/username tmpfs defaults,noatime,uid=username,gid=usergroup,nosuid,size=500M 0 0
tmpfs /var/web-cache/opera/username tmpfs defaults,noatime,uid=username,gid=usergroup,nosuid,size=500M 0 0

Manage cache directories

Under root permissions create following directories:

# sudo mkdir -p /var/web-cache/vivaldi/username
# sudo mkdir -p /var/web-cache/firefox/username
# sudo mkdir -p /var/web-cache/opera/username

And change user’s permissions:

# sudo chown username:usergroup /var/web-cache/vivaldi/username
# sudo chown username:usergroup /var/web-cache/firefox/username
# sudo chown username:usergroup /var/web-cache/opera/username

Setting cache location in browsers

After the preparation on the OS side it is necessary to prepare the browser side, the location of the cache directory should be changed in the settings of a browser.


In the Firefox browser it is very easy to change the location of cache directory inside the configuration settings, just enter the following URL in the address bar of a browser:


You will see a page like that:

Just accept and go further to configuration settings where you will find the records related to browser’s cache, two of those records are interesting:



You can set those records to your own values according to directories in /var that has been prepared earlier.

The sample of such configuration is below:

Chromium based browsers Vivaldi, Opera, Chrome etc.

Command line argument passed to the executable of the browser:


Cache directory

Change location:
# cd ~/.cache/
# rm -fr vivaldi-snapshot/
# ln -s /var/web-cache/vivaldi/username/ vivaldi-snapshot
Sample of output from ls -ls command after links are applied

Configuration directory


Additional information

How to speed up the Vivaldi web browser