Have tried many things but the package can't be installed, attempted to remove corrupted packages but they were never there. Also tried reconfiguring and force-overwrite]
root@chels-5f46dc6b67-7tct5:/var/lib/dpkg/info# apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
nvidia-418
The following NEW packages will be installed:
nvidia-418
0 upgraded, 1 newly installed, 0 to remove and 111 not upgraded.
8 not fully installed or removed.
Need to get 97.9 MB of archives.
After this operation, 410 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64 nvidia-418 418.126.02-0ubuntu1 [97.9 MB]
Get:1 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64 nvidia-418 418.126.02-0ubuntu1 [97.9 MB]
Get:1 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64 nvidia-418 418.126.02-0ubuntu1 [97.9 MB]
Get:1 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64 nvidia-418 418.126.02-0ubuntu1 [97.9 MB]
Get:1 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64 nvidia-418 418.126.02-0ubuntu1 [97.9 MB]
Fetched 71.3 MB in 2min 5s (572 kB/s)
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 1.)
debconf: falling back to frontend: Readline
(Reading database ... 128611 files and directories currently installed.)
Preparing to unpack .../nvidia-418_418.126.02-0ubuntu1_amd64.deb ...
Unpacking nvidia-418 (418.126.02-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/nvidia-418_418.126.02-0ubuntu1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/x86_64-linux-gnu/libGLX_indirect.so.0', which is also in package libglx-mesa0:amd64 20.0.8-0ubuntu1~18.04.1
Errors were encountered while processing:
/var/cache/apt/archives/nvidia-418_418.126.02-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)