sudo apt update && sudo apt upgrade
.sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get purge nvidia*
sudo apt-get install nvidia-driver-396
ubuntu-drivers autoinstall
command installs drivers that are appropriate for automatic installation including their dependencies, and the Nvidia driver will also be updated automatically when an update is available.