Problem removing nvidia-driver-440 and all other CUDA/PPA drivers on Ubuntu 18.04

Hi,

I tried to do a “apt upgrade” today on the host computer with Ubuntu 18.04 (via auto-update system prompt) but there were errors in the upgrade process. And when I want to install the minicom, I have experienced with the following errors :

$ sudo apt install minicom
Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run ‘apt --fix-broken install’ to correct these.
The following packages have unmet dependencies:
libnvidia-decode-440 : Depends: libnvidia-compute-440 (= 440.118.02-0ubuntu1) but 440.100-0ubuntu0.18.04.1 is to be installed
nvidia-driver-440 : Depends: libnvidia-compute-440 (= 440.118.02-0ubuntu1) but 440.100-0ubuntu0.18.04.1 is to be installed
Recommends: libnvidia-compute-440:i386 (= 440.118.02-0ubuntu1)
Recommends: libnvidia-decode-440:i386 (= 440.118.02-0ubuntu1)
Recommends: libnvidia-encode-440:i386 (= 440.118.02-0ubuntu1)
Recommends: libnvidia-ifr1-440:i386 (= 440.118.02-0ubuntu1)
Recommends: libnvidia-fbc1-440:i386 (= 440.118.02-0ubuntu1)
Recommends: libnvidia-gl-440:i386 (= 440.118.02-0ubuntu1)
E: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).

I have tried all the following commands but none of them can help me remove the drivers :
$ nvidia-smi
Failed to initialize NVML: Driver/library version mismatch

$ sudo dpkg --remove-architecture i386
dpkg: error: cannot remove architecture ‘i386’ currently in use by the database

sudo dpkg -P (dpkg -l | grep nvidia-driver | awk ‘{print $2}’)
dpkg: dependency problems prevent removal of nvidia-driver-440:
cuda-drivers depends on nvidia-driver-440 (>= 440.33.01); however:
Package nvidia-driver-440 is to be removed.
dpkg: err or processing package nvidia-driver-440 (–purge):
dependency problems - not removing
Errors were encountered while processing: nvidia-driver-440

$ sudo apt autoremove
Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run ‘apt --fix-broken install’ to correct these.
The following packages have unmet dependencies:
libnvidia-decode-440 : Depends: libnvidia-compute-440 (= 440.118.02-0ubuntu1) but 440.100-0ubuntu0.18.04.1 is installed
nvidia-driver-440 : Depends: libnvidia-compute-440 (= 440.118.02-0ubuntu1) but 440.100-0ubuntu0.18.04.1 is installed
Recommends: libnvidia-compute-440:i386 (= 440.118.02-0ubuntu1)
Recommends: libnvidia-decode-440:i386 (= 440.118.02-0ubuntu1)
Recommends: libnvidia-encode-440:i386 (= 440.118.02-0ubuntu1)
Recommends: libnvidia-ifr1-440:i386 (= 440.118.02-0ubuntu1)
Recommends: libnvidia-fbc1-440:i386 (= 440.118.02-0ubuntu1)
Recommends: libnvidia-gl-440:i386 (= 440.118.02-0ubuntu1)
E: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).

sudo add-apt-repository --remove ppa:graphics-drivers/ppa** ** sudo apt-get --purge remove “cublas” “cufft” “curand” “cusolver” “cusparse” “npp” “nvjpeg” "cuda" "nsight"**
$ sudo apt-get --purge remove "nvidia"
(giving same errors as for “apt install”)

May I know if there is anything else I can do so that apt can work again or I have to reset the Ubuntu computer. Any pointers will be very helpful.

I’m facing somewhat the same issue. So, anyone? any take on this? I

Hi, I found no solution and ended up re-installing the Ubuntu.

first I’d try to reinstall the nvidia-driver. If that doesn’t work, there is always dpkg -P --force-all