5

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.enter image description here

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.list

Notes: 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 http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ 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 http://us.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ 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 http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ 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 http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ 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 http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-proposed main universe restricted multiverse

ubuntu-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-free

Note: 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-source

Note: Again, the first three are the ones I want to remove, and the last is for my wireless card.

  • Wiking, I've done that already, thanks! I'm adding the results of those commands to my post (comments would be too short). – Eate Jul 11 '18 at 23:13
4
  1. nvidia-installer --uninstall
  2. sudo apt remove nvidia-*
4

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 builtin

The 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 expreiments, follow guide below.

The described below is for exprerimental purposes only - if you're not sure don't do it!

Press CTRL+ALT+F2, log in and remove all of the nvidia staff:

sudo apt remove nvidia-*

Next remove proprieatary PPA GPU drivers repository. Run in terminal:

sudo add-apt-repository --remove ppa:graphics-drivers/ppa
sudo apt update

Afterwards check available drivers in terminal:

ubuntu-drivers devices

You'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 update

Install your desired nvidia 396 again:

sudo ubuntu-drivers autoinstall

Reboot:

sudo reboot

Additionally see this my post.

  • 1
    I removed the ppa to see what would happen. It removed only version 396 (the one I want!) – Eate Jul 12 '18 at 23:51
  • Yes, thank you. I was a bit confused, but I now see how the ubuntu-drivers works (doesn't look at installed drivers, looks at all the installed and recommended drivers. – Eate Jul 14 '18 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.