3

On my dev system (Kubuntu 20.04) I just installed CUDA 11.3. After checking the installation, I found some older CUDA packages installed, which are remainders from experiments some time ago. That CUDA 11.2 installation was incomplete, so I needed to remove the packages one-by-one (not via the "cuda" metapackage). I was able remove all of them except one: cuda-cudart-11-2.

When running sudo apt remove cuda-cudart-11-2 or sudo apt --purge remove cuda-cudart-11-2, apt names two new packages that need to be installed before removing cuda-cudart-11-2:

  • cuda-toolkit-11-config-common
  • cuda-toolkit-config-common

My first question: How can removing a package require installing new packages? I have never seen this before.

I confirmed the installation of those packages as proposed by apt and got errors:

me@mypc:~$ sudo apt remove cuda-cudart-11-2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  cuda-toolkit-11-config-common cuda-toolkit-config-common
The following packages will be REMOVED:
  cuda-cudart-11-2
The following NEW packages will be installed:
  cuda-toolkit-11-config-common cuda-toolkit-config-common
0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
Need to get 0 B/32.2 kB of archives.
After this operation, 514 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 380817 files and directories currently installed.)
Preparing to unpack .../cuda-toolkit-11-config-common_11.3.109-1_all.deb ...
Unpacking cuda-toolkit-11-config-common (11.3.109-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-toolkit-11-config-common_11.3.109-1_all.deb (--unpack):
 trying to overwrite '/etc/ld.so.conf.d/989_cuda-11.conf', which is also in package cuda-cudart-11-2 11.2.152-1
Preparing to unpack .../cuda-toolkit-config-common_11.3.109-1_all.deb ...
Unpacking cuda-toolkit-config-common (11.3.109-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-toolkit-config-common_11.3.109-1_all.deb (--unpack):
 trying to overwrite '/etc/ld.so.conf.d/000_cuda.conf', which is also in package cuda-cudart-11-2 11.2.152-1
Errors were encountered while processing:
 /var/cache/apt/archives/cuda-toolkit-11-config-common_11.3.109-1_all.deb
 /var/cache/apt/archives/cuda-toolkit-config-common_11.3.109-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

As far as I understand, this says that cuda-toolkit-11-config-common can not be installed because the config file /etc/ld.so.conf.d/989_cuda-11.conf can not be overwritten because it is in use by cuda-cudart-11-2 (which can not be removed until cuda-toolkit-11-config-common is installed). This sounds like a kind of deadlock to me.

My seconds question: If this is actually a deadlock, how can I solve it?

Silicomancer
  • 613
  • 2
  • 12
  • 34

0 Answers0