Failed installation of package breaks apt-get
Solution 1:
I fix this issue only with:
sudo apt-get -o Dpkg::Options::="--force-overwrite" install --fix-broken
Solution 2:
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.
Solution 3:
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
Solution 4:
I excuted
sudo add-apt-repository ppa:graphics-drivers
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list'
sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda_learn.list'
(b) Install CUDA 10.1 packages, including the CuDNN library
sudo apt update
sudo apt install cuda-10-1
sudo apt install libcudnn7
Check this link I didnt remove any driver just installed above stuff and updated .profile
nano ~/.profile
# set PATH for cuda 10.1 installation
if [ -d "/usr/local/cuda-10.1/bin/" ]; then
export PATH=/usr/local/cuda-10.1/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
fi