I am running apt --fix-broken install
. I get:
dpkg-divert: error: mismatch on package when removing 'diversion of /usr/lib/i386-linux-gnu.so.1 by libnvidia-gl-390'
found 'diversion of /usr/lib/i386-linux-gnu.so.1 to /usr/lib/i386-linux-gnu.so.1.distrib by nvidia-340
(also other stuff but let's take it one step at a time)
Aha! Thinks I; I'll remove nvidia-340 then, except ...
apt remove nvidia-340
...
Package 'nvidia-340' is not installed, so not removed
How do I remove diversion errors from packages that look to me at though they aren't installed? What am I missing?
Looks like this is a bug with Ubuntu. package libnvidia-gl-390 (not installed) failed to install/upgrade: new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2 (NOT FIXED)
The workaround I did was #5, Yuri's improvement of Alexandre's suggestion
I posted a more laborious answer to the bug report, you can find here https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-390/+bug/1768050/comments/8