Failed installation of package breaks apt-get

I fix this issue only with:

sudo apt-get -o Dpkg::Options::="--force-overwrite" install --fix-broken

Similar to the command of StrugglingProgrammer, I had to make sure I would uninstall all cuda packages (the cuda-demo*, e.g.)

You can check which those might be with:

dpkg -l | grep -i cuda
dpkg -l | grep -i nvidia

So maybe try either

sudo apt-get remove --purge cuda-* libcuda* nvidia* 

(for the whole batch) or select more specifically like:

sudo apt-get remove --purge cuda-drivers libcuda* cuda-runtime* cuda-8-0 cuda-demo*

For me specifially (after trying a failed install of cuda-8-0 and libcudnn6) it was:

sudo apt-get remove --purge nvidia* cuda-drivers libcuda* cuda-runtime* cuda-8-0 cuda-demo*

Hope that may be of help.


I resolved this by removing everything installed in a single apt-get remove command:

sudo apt-get remove --purge nvidia* cuda-drivers libcuda1-396 cuda-runtime-9-2 cuda-9.2 cuda-demo-suite-9-2  cuda