Install Nvidia Drivers on Ubuntu with One Single Command. This will work on any ubuntu based linux Distros
Open terminal (CTRL + ALT + T) then update the system by running the below commands.
sudo apt update
sudo apt upgrade
Once its done, type the below command
sudo ubuntu-drivers devices
It detects the Nvidia Graphic Card and list out supported drivers.
If you notice the above screen shot, it shows my Graphic Card (Nvidia GE-FORCE GT 730) and the list of all drivers. Choose the driver you want to install. For example lets say, I want to install Nvidia-driver-460, then I need to run the below command to install the non-free recommended driver.
sudo apt install nvidia-driver-460 -y
If you don’t know which driver is the best for your computer, then run the below to autoinstall the recommended Nvidia drivers.
sudo ubuntu-drivers autoinstall