Reinstall NVIDIA drivers for Ubuntu 16.04
In case someone updates the Kernel on their Linux OS. It is not advised to update the packages on Linux OS unless completely necessary for your work.
Step-by-step guide
Before you move on from this point, make sure to check if your NVIDIA driver is working using:
nvidia-smi
If it reports anything other than the status/readings of your installed graphics card, it needs to be re-installed; or to boot from an earlier kernel depending how much was done after the initial update/change to your system/OS.
If you have the NVIDIA .run file already
If Exxact originally provided the NVIDIA driver installation, it can be found in either the '/root' or '/home' directory.
# login/change to root permissions sudo bash service lightdm stop ./NVIDIA* [tab to fill in the rest] # accept terms, and answer 'no' to everything else
If it fails to install, then it is possible something beyond updating the kernel was performed that may have installed conflicting packages that will prevent the NVIDIA driver from installing using our typical '.run' file method.
If you need to re-obtain or update the the NVIDIA driver
- Helps if you do this via SSH from another system to copy/paste the link when using the 'wget' command
- Requires that you know what Graphics card is installed (the command 'lspci | grep -i NVIDIA' might help identify the model# if you are remote; not guaranteed)
- Visit NVIDIA's driver search website and search for the driver
- Click 'download'
- Right-click on the 'download' button here, and 'Copy link address'
On the target computer that needs the NVIDIA driver '.run' file; run this command to download the file from NVIDIA's website:
# This is an example, please do not just copy/paste the exact contents below... It may not be the correct driver for YOUR graphics card installed wget http://us.download.nvidia.com/XFree86/Linux-x86_64/410.73/NVIDIA-Linux-x86_64-410.73.run
Make the file executable using 'chmod +x'
# This is an example, please do not just copy/paste the exact contents below... It may not be the correct driver for YOUR graphics card installed chmod +x http://us.download.nvidia.com/XFree86/Linux-x86_64/410.73/NVIDIA-Linux-x86_64-410.73.run
Disable any GUI-related processes and execute the file
# login/change to root permissions sudo bash service lightdm stop ./NVIDIA* [tab to fill in the rest] # accept terms, and answer 'no' to everything else
If it still does not work
# This is an example, please do not just copy/paste the exact 'nvidia-xxx' below... It may not be the correct driver for YOUR graphics card installed # Check the version you need to install (what does the specific version start with? i.e.: nvidia-367, or nvidia-390) # login/change to root permissions sudo bash systemctl stop lightdm.service apt-get -y remove nvidia* add-apt-repository -y ppa:graphics-drivers/ppa apt-get update && apt-get -y install nvidia-410 reboot
If you need to remove prior NVIDIA installation
Please be careful what you remove. This may also remove CUDA or prevent you from re-installing NVIDIA drivers.
sudo apt purge nvidia-*
Additionally, the links below elaborate on removing proprietary NVIDIA driver in Ubuntu:
- https://askubuntu.com/questions/1054242/completely-removing-old-nvidia-drivers
- https://askubuntu.com/questions/1054305/cannot-login-to-ubuntu-16-04-after-updating/1054310#1054310
http://karlcode.owtelse.com/blog/2017/03/13/reverting-to-a-previous-kernel/
Related articles