I wrote this tutorial because I've seen bits and chips of this topic, but never a full tutorial (especially not an up-to-date one).
This tutorial is intented for miners who want to mine Monero (or any other coin supported by xmr-stak) on a Ubuntu based system, with Nvidia cards (note: the tutorial works fine with CPU-only mining, just skip the driver installing part, and use -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF
flags for cmake)
I assume You have a fresh install of Ubuntu, make sure Your system is up-to-date
sudo apt update && sudo apt upgrade
Install the latest version of the Nvidia driver avialable in the apt repository (which is 384 as of now)