CUDA can't be installed or uninstalled and dkpg can't install anything
When I do sudo apt --fix-broken install
Errors were encountered while processing:
/tmp/apt-dpkg-install-6CZ1pM/00-cuda-cudart-11-0_11.0.221-1_amd64.deb
/tmp/apt-dpkg-install-6CZ1pM/01-cuda-driver-dev-11-0_11.0.221-1_amd64.deb
/tmp/apt-dpkg-install-6CZ1pM/02-cuda-cudart-dev-11-0_11.0.221-1_amd64.deb
/tmp/apt-dpkg-install-6CZ1pM/03-cuda-nvcc-11-0_11.0.221-1_amd64.deb
/tmp/apt-dpkg-install-6CZ1pM/04-cuda-cupti-11-0_11.0.221-1_amd64.deb
/tmp/apt-dpkg-install-6CZ1pM/05-cuda-cupti-dev-11-0_11.0.221-1_amd64.deb
/tmp/apt-dpkg-install-6CZ1pM/06-cuda-nvprof-11-0_11.0.221-1_amd64.deb
/tmp/apt-dpkg-install-6CZ1pM/07-cuda-nvtx-11-0_11.0.167-1_amd64.deb
/tmp/apt-dpkg-install-6CZ1pM/08-cuda-nvrtc-11-0_11.0.221-1_amd64.deb
/tmp/apt-dpkg-install-6CZ1pM/09-cuda-nvrtc-dev-11-0_11.0.221-1_amd64.deb
/tmp/apt-dpkg-install-6CZ1pM/10-libcublas-11-0_11.2.0.252-1_amd64.deb
/tmp/apt-dpkg-install-6CZ1pM/11-libcublas-dev-11-0_11.2.0.252-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
When I do sudo apt install aptitude
The following packages have unmet dependencies:
aptitude : Depends: aptitude-common (= 0.8.12-1ubuntu4) but it is not going to be installed
Depends: libcwidget4 (>= 0.5.18-1) but it is not going to be installed
Depends: libxapian30 (>= 1.4.14~) but it is not going to be installed
Recommends: libparse-debianchangelog-perl but it is not going to be installed
cuda-command-line-tools-11-0 : Depends: cuda-cupti-dev-11-0 (>= 11.0.221) but it is not going to be installed
Depends: cuda-nvprof-11-0 (>= 11.0.221) but it is not going to be installed
Depends: cuda-nvtx-11-0 (>= 11.0.167) but it is not going to be installed
cuda-compiler-11-0 : Depends: cuda-nvcc-11-0 (>= 11.0.221) but it is not going to be installed
cuda-libraries-11-0 : Depends: cuda-cudart-11-0 (>= 11.0.221) but it is not going to be installed
Depends: cuda-nvrtc-11-0 (>= 11.0.221) but it is not going to be installed
Depends: libcublas-11-0 (>= 11.2.0.252) but it is not going to be installed
cuda-libraries-dev-11-0 : Depends: cuda-cudart-dev-11-0 (>= 11.0.221) but it is not going to be installed
Depends: cuda-driver-dev-11-0 (>= 11.0.221) but it is not going to be installed
Depends: cuda-nvrtc-dev-11-0 (>= 11.0.221) but it is not going to be installed
Depends: libcublas-dev-11-0 (>= 11.2.0.252) but it is not going to be installed
cuda-samples-11-0 : Depends: cuda-nvrtc-dev-11-0 but it is not going to be installed
Depends: cuda-nvcc-11-0 but it is not going to be installed
Depends: libcublas-dev-11-0 but it is not going to be installed
Depends: cuda-cudart-dev-11-0 but it is not going to be installed
Depends: cuda-driver-dev-11-0 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Any help would be appreciated, I'm new to this
Also tried
sudo apt-get clean
sudo apt-get -f install
could not find cuda file inside /usr/local however nvidia-smi saids CUDA version 11.4
I think I've found the solution, it seems to be working now
Upgrade or uninstall cuda to allow apt-get to work
dpkg -l | grep cuda- | awk '{print $2}' | xargs -n1 sudo dpkg --purge
df -h
sudo apt-get purge nvidia*
sudo apt-get -f install
sudo apt autoremove