Attempting to remove a package complains about unmet dependencies
I had the same problem. This saved me (replace with your package version):
sudo dpkg -i --force-overwrite /var/cache/apt/archives/libcublas-dev_10.2.1.243-1_amd64.deb
And then:
sudo apt --fix-broken install
dpkg: error processing archive /var/cuda-repo-10-1-local-10.1.243-418.87.00/./libcublas-dev_10.2.1.243-1_amd64.deb (--unpack): trying to overwrite '/usr/lib/x86_64-linux-gnu/libcublas_static.a', which is also in package nvidia-cuda-dev 9.1.85-3ubuntu1 dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
2 Packages ,that have the same file
sudo mv usr/lib/x86_64-linux-gnu/libcublas_static.a usr/lib/x86_64-linux-gnu/libcublas_static.a.bak
Then
sudo dpkg --configure -a
If this work, try to purge cuda again