I recently installed a fresh installation of Ubuntu, and downloaded some Nvidia drivers via nvidia-driver-390. I noticed that nvidia-340 was also installed (as a "binary driver" instead of a "driver metapackage"). Interesting. Later, I installed nvidia-driver-396. I'd like to remove versions 340 and 390, so I can only use 396. I have used sudo apt remove --purge nvidia-340 nvidia-390 and also uninstalled some of the related packages (nvidia-common, nvidia-current, nvidia-settings, nvidia-prime, nvidia-kernel-common*, etc.) At this point, I'm just trying to remove every trace of Nvidia drivers from my system and start fresh. Unfortunately, in the included "Software and Updates", drivers 340, 390, and 396 are still listed. A screenshot is attached. Thanks for your help.
ls -la /etc/apt/sources.list.d:
total 44
drwxr-xr-x 2 root root 4096 Jul 10 08:43 .
drwxr-xr-x 6 root root 4096 May 20 12:58 ..
-rw-r--r-- 1 root root 142 Jul 10 08:43 alexlarsson-ubuntu-flatpak-bionic.list
-rw-r--r-- 1 root root 142 Jul 10 08:43 alexlarsson-ubuntu-flatpak-bionic.list.save
-rw-r--r-- 1 root root 57 Jul 10 08:43 etcher.list
-rw-r--r-- 1 root root 57 Jul 10 08:43 etcher.list.save
-rw-r--r-- 1 root root 132 Jul 10 08:43 gezakovacs-ubuntu-ppa-bionic.list
-rw-r--r-- 1 root root 132 Jul 10 08:43 gezakovacs-ubuntu-ppa-bionic.list.save
-rw-r--r-- 1 root root 189 Jul 10 08:43 google-chrome-beta.list
-rw-r--r-- 1 root root 189 Jul 10 08:43 google-chrome-beta.list.save
-rw-r--r-- 1 root root 144 Jul 10 08:43 graphics-drivers-ubuntu-ppa-bionic.listNotes: So you have to remove the ppa to completely remove it?
cat /etc/apt/sources.list:
# deb cdrom:[Ubuntu 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)]/ bionic main restricted
# See for how to upgrade to
# newer versions of the distribution.
deb bionic main restricted
# deb-src bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb bionic-updates main restricted
# deb-src bionic-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb bionic universe
# deb-src bionic universe
deb bionic-updates universe
# deb-src bionic-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb bionic multiverse
# deb-src bionic multiverse
deb bionic-updates multiverse
# deb-src bionic-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb bionic-backports main restricted universe multiverse
# deb-src bionic-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb bionic partner
# deb-src bionic partner
deb bionic-security main restricted
# deb-src bionic-security main restricted
deb bionic-security universe
# deb-src bionic-security universe
deb bionic-security multiverse
# deb-src bionic-security multiverse
deb bionic-proposed main universe restricted multiverseubuntu-drivers devices:
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001382sv000010DEsd00001065bc03sc00i00
vendor : NVIDIA Corporation
model : GM107 [GeForce GTX 745]
driver : nvidia-340 - third-party free
driver : nvidia-driver-390 - third-party free
driver : nvidia-driver-396 - third-party free recommended
driver : xserver-xorg-video-nouveau - distro free builtin
== /sys/devices/pci0000:00/0000:00:1c.7/0000:04:00.0 ==
modalias : pci:v000014E4d00004365sv00001028sd00000016bc02sc80i00
vendor : Broadcom Limited
model : BCM43142 802.11b/g/n (Wireless 1704 802.11n + BT 4.0)
driver : bcmwl-kernel-source - distro non-freeNote: The second one is my wireless card, the first one is my graphics card that this is about.
ubuntu-drivers list:
nvidia-driver-390
nvidia-340
nvidia-driver-396
bcmwl-kernel-sourceNote: Again, the first three are the ones I want to remove, and the last is for my wireless card.
14 Answers
Pay your attention to ubuntu-drivers devices command output - there are following lines:
driver : nvidia-340 - third-party free
driver : nvidia-driver-390 - third-party free
driver : nvidia-driver-396 - third-party free recommended
driver : xserver-xorg-video-nouveau - distro free builtinThe lines mean you can use nvidia 340, 390, 396 drivers from third-party repository and open-source nouveau driver from distro repository. Only one driver is recommended to you. The list doesn't mean all of the mentioned drivers has been installed in your system. It indicates only potential possibility to install the drivers. The list can't be changed manually as being formed with ubuntu-drivers utility designed to automate proprietary drivers detecting, inspecting and installing from available to Ubuntu repositories.
Thus, to change the list it's necessary to remove third-party repository, which is proprietary GPU drivers repo in the particular case. But it's highly unrecommended to do, since your goal is to keep nvidia 396 driver anyway and remove from automatically created list nvidia 340 and 390 drivers. If you remove the third-party repository, only distro drivers will be detected as available, which will be in the particular case only 340 and 390 - thus, you'll obtain most undesired for you situation.
My suggestion for you is to do nothing. Your system looks healthy, everything works well.
If you like experiments, follow guide below.
The described below is for experimental purposes only - if you're not sure don't do it!
Press Ctrl+Alt+F4, log in and remove all of the nvidia staff:
sudo apt remove nvidia-*Next remove proprietary PPA GPU drivers repository. Run in terminal:
sudo add-apt-repository --remove ppa:graphics-drivers/ppa
sudo apt updateAfterwards check available drivers in terminal:
ubuntu-drivers devicesYou'll see the third-party nvidia drivers have dissapeared and only distro nvidia drivers are available. Among the drivers nvidia 396 will be absent since the driver isn't a part of Ubuntu distro repository.
Add your PPA proprietary GPU drivers repository back:
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt updateInstall your desired nvidia 396 again:
sudo ubuntu-drivers autoinstallReboot:
sudo rebootAfter reboot, type nvidia-smi which will show different information about your graphic card like below:
xyz@xyz-workstation:~$ nvidia-smi
Mon Apr 27 12:41:50 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.64.00 Driver Version: 440.64.00 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 166... On | 00000000:01:00.0 Off | N/A |
| N/A 45C P8 1W / N/A | 470MiB / 5944MiB | 5% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1905 G /usr/lib/xorg/Xorg 28MiB |
| 0 2058 G /usr/bin/gnome-shell 47MiB |
| 0 2956 G /usr/lib/xorg/Xorg 145MiB |
| 0 3133 G /usr/bin/gnome-shell 120MiB |
| 0 3587 G ...AAAAAAAAAAAACAAAAAAAAAA= --shared-files 122MiB |
+-----------------------------------------------------------------------------+For systems having nvidia-prime, if it returns an error then type sudo prime-select intel and then reboot and then type sudo prime-select nvidia and then reboot again. Now type nvidia-smi and it should work. This method works on most of the system with kernel till 5.4
Additionally see this my post.
3nvidia-installer --uninstallsudo apt remove nvidia-*
I faced the below error nvidia-driver connectivity issue on AWS VM after a reboot.
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
Uninstall Nvidia Driver
sudo apt remove nvidia-*Add Nvidia drivers PPA
sudo add-apt-repository --remove ppa:graphics-drivers/ppa sudo apt updateInstall the nviida-drivers (change 430 to your requirement)
sudo apt-get install nvidia-driver-430(optional) Install Nvidia-drivers
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L | sudo apt-key add - curl -s -L | sudo tee /etc/apt/sources.list.d/nvidia-docker.list sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit sudo systemctl restart docker- (optional) Install Nvidia Container Run time
sudo apt-get install nvidia-container-runtime
Make sure that nvidia is completely removed before new install or update.
sudo apt-get remove --purge '^nvidia-.*'