On Ubuntu 18.04, I am having some problems with my installation of CUDA, so I would like to uninstall CUDA and start from scratch.
So, I tried the following:
sudo apt remove cuda
But this then printed out the following:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
cuda-libraries-dev-10-1 : Depends: libcublas-dev (>= 10.2.1.243) but it is not going to be installed
cuda-samples-10-1 : Depends: libcublas-dev (>= 10.2.1.243) but it is not going to be installed
cuda-visual-tools-10-1 : Depends: libcublas-dev (>= 10.2.1.243) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
I am very confused by this. It seems to be telling me that cuda-libraries-dev-10-1
, cuda-samples-10-1
, and cuda-visual-tools-10-1
all depend on libcublas-dev
, with at least version 10.2.1.243. And then it is saying that this version of libcublas-dev
is not going to be installed. But I am trying to unistall CUDA, not install it. Therefore, why should my system care that some of the packages that come with CUDA have unmet dependencies, when I am trying to remove these packages anyway?
I can understand that if I was trying to install cuda-libraries-dev-10-1
, cuda-samples-10-1
, or cuda-visual-tools-10-1
, then this message would make sense. But if I am trying to remove these, who cares whether they have unmet dependencies?
Update
As suggested, I also ran:
apt --fix-broken install
This then printed out:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
g++-6 libaccinj64-9.1 libcublas9.1 libcudart9.1 libcufft9.1 libcufftw9.1 libcuinj64-9.1 libcurand9.1 libcusolver9.1 libcusparse9.1 libnppc9.1 libnppial9.1 libnppicc9.1
libnppicom9.1 libnppidei9.1 libnppif9.1 libnppig9.1 libnppim9.1 libnppist9.1 libnppisu9.1 libnppitc9.1 libnpps9.1 libnvblas9.1 libnvgraph9.1 libnvrtc9.1 libnvtoolsext1 libnvvm3
libstdc++-6-dev libthrust-dev libvdpau-dev nvidia-cuda-dev nvidia-cuda-doc nvidia-cuda-gdb nvidia-opencl-dev nvidia-profiler nvidia-visual-profiler ocl-icd-opencl-dev
opencl-c-headers
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libcublas-dev
The following NEW packages will be installed
libcublas-dev
0 to upgrade, 1 to newly install, 0 to remove and 62 not to upgrade.
83 not fully installed or removed.
Need to get 0 B/38.9 MB of archives.
After this operation, 109 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 file:/var/cuda-repo-10-1-local-10.1.243-418.87.00 libcublas-dev 10.2.1.243-1 [38.9 MB]
(Reading database ... 211122 files and directories currently installed.)
Preparing to unpack .../libcublas-dev_10.2.1.243-1_amd64.deb ...
Unpacking libcublas-dev (10.2.1.243-1) ...
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)
Errors were encountered while processing:
/var/cuda-repo-10-1-local-10.1.243-418.87.00/./libcublas-dev_10.2.1.243-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Update
As suggested in the comments, I then tried running:
sudo apt full-upgrade
This printed out the following:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
cuda-libraries-dev-10-1 : Depends: libcublas-dev (>= 10.2.1.243) but it is not installed
cuda-samples-10-1 : Depends: libcublas-dev (>= 10.2.1.243) but it is not installed
cuda-visual-tools-10-1 : Depends: libcublas-dev (>= 10.2.1.243) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
This is exactly the same print out as when I ran sudo apt remove cuda
.
Update
As suggested in the comments, I ran grep -r deb /etc/apt/sources.list /etc/apt/sources.list.d
. This gave the following output:
/etc/apt/sources.list:#deb cdrom:[Ubuntu 18.04.3 LTS _Bionic Beaver_ - Release amd64 (20190805)]/ bionic main restricted
/etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ bionic main restricted
/etc/apt/sources.list:# deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic main restricted
/etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
/etc/apt/sources.list:# deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
/etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ bionic universe
/etc/apt/sources.list:# deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic universe
/etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ bionic-updates universe
/etc/apt/sources.list:# deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic-updates universe
/etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ bionic multiverse
/etc/apt/sources.list:# deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic multiverse
/etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
/etc/apt/sources.list:# deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
/etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
/etc/apt/sources.list:# deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
/etc/apt/sources.list:# deb http://archive.canonical.com/ubuntu bionic partner
/etc/apt/sources.list:# deb-src http://archive.canonical.com/ubuntu bionic partner
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu bionic-security main restricted
/etc/apt/sources.list:# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu bionic-security universe
/etc/apt/sources.list:# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu bionic-security multiverse
/etc/apt/sources.list:# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
/etc/apt/sources.list.d/cuda.list:deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /
/etc/apt/sources.list.d/cuda-10-0-local-10.0.130-410.48.list:deb file:///var/cuda-repo-10-0-local-10.0.130-410.48 /
/etc/apt/sources.list.d/cuda-10-1-local-10.1.243-418.87.00.list:deb file:///var/cuda-repo-10-1-local-10.1.243-418.87.00 /
apt
is telling you twice to runapt --fix-broken install
. Have you tried that? – Murphy Sep 03 '19 at 15:44sudo apt update
and thensudo apt full-upgrade
. Post the entire output here. – DK Bose Sep 03 '19 at 15:58sudo apt update
? Where is that output? – DK Bose Sep 03 '19 at 16:5662 packages can be upgraded. Run 'apt list --upgradable' to see them.
. So I ranapt list --upgradeable
, and of the 62 packages listed, the only one containingcuda
is:cuda-repo-ubuntu1804/unknown 10.1.243-1 amd64 [upgradable from: 10.0.130-1]
– Karnivaurus Sep 03 '19 at 17:00