Software & Updates
In the Software & Updates
> Additional Drivers
tab, select the preferred driver from the list. It can take some time, watch the progress spinner. A reboot is required to switch the driver.
Terminal
Sometimes, a person needs to install different Nvidia Drivers or try to correct Nvidia drivers outside of the Software Store.
If you have already installed any Nvidia-driver, first you must run
sudo apt remove --purge '^nvidia-.*'
to remove all of the previous driver. Otherwise, it may leave files behind that affect the new driver install.
From Standard Universe repository, try (same action as Software & Updates):
sudo ubuntu-drivers install
For a specific driver, proceed below:
Ensure you have the repository for the Nvidia driver from canonical team:
sudo add-apt-repository ppa:graphics-drivers/ppa
Update your sources and install the driver, replacing XXX with the three digit driver number. For example, if you are installing the 545 driver, you would have nvidia-driver-545
entered in your terminal:
If wayland is installed, whether you are using it or not, you may need:
sudo apt install --install-recommends nvidia-driver-XXX
Non-Wayland users can run:
sudo apt update && sudo apt install nvidia-driver-XXX nvidia-dkms-XXX
DKMS is Dynamic Kernel Module Support. This allows your kernel to upgrade without you needing to reinstall the driver after the new kernel is installed.
I recommend using the X-Swat team updates... Mesa and the like...
sudo add-apt-repository ppa:ubuntu-x-swat/updates
sudo apt update && sudo apt full-upgrade
I no longer include oibaf driver source as a long term recommendation since they are too quick (IMO) to drop support for releases. However, if interested, if your release is up to date with what Oibaf is offering, their driver patches and updates are quite good.