无法修复损坏的安装

无法修复损坏的安装

由于安装中断,我无法在 ubuntu 上安装任何新软件。我尝试了以下命令来修复它:

$ sudo rm /var/lib/apt/lists/lock
$ sudo rm /var/lib/dpkg/lock
$ sudo rm /var/lib/dpkg/lock-frontend
$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of cuda-libraries-11-1:
 cuda-libraries-11-1 depends on cuda-nvrtc-11-1 (>= 11.1.105); however:
  Version of cuda-nvrtc-11-1 on system is 11.1.74-1.
 cuda-libraries-11-1 depends on libcublas-11-1 (>= 11.3.0.106); however:
  Version of libcublas-11-1 on system is 11.2.1.74-1.
 cuda-libraries-11-1 depends on libcufft-11-1 (>= 10.3.0.105); however:
  Version of libcufft-11-1 on system is 10.3.0.74-1.
 cuda-libraries-11-1 depends on libcurand-11-1 (>= 10.2.2.105); however:
  Version of libcurand-11-1 on system is 10.2.2.74-1.
 cuda-libraries-11-1 depends on libcusolver-11-1 (>= 11.0.1.105); however:
  Version of libcusolver-11-1 on system is 11.0.0.74-1.
 cuda-libraries-11-1 depends on libcusparse-11-1 (>= 11.3.0.10); however:
  Version of libcusparse-11-1 on system is 11.2.0.275-1.
 cuda-libraries-11-1 depends on libnpp-11-1 (>= 11.1.2.301); however:
  Version of libnpp-11-1 on system is 11.1.1.269-1.
 cuda-libraries-11-1 depends on libnvjpeg-11-1 (>= 11.3.0.105); however:
  Version of libnvjpeg-11-1 on system is 11.2.0.74-1.

dpkg: error processing package cuda-libraries-11-1 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-compiler-11-1:
 cuda-compiler-11-1 depends on cuda-nvcc-11-1 (>= 11.1.105); however:
  Version of cuda-nvcc-11-1 on system is 11.1.74-1.

dpkg: error processing package cuda-compiler-11-1 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-toolkit-11-1:
 cuda-toolkit-11-1 depends on cuda-compiler-11-1 (>= 11.1.1); however:
  Package cuda-compiler-11-1 is not configured yet.
 cuda-toolkit-11-1 depends on cuda-libraries-11-1 (>= 11.1.1); however:
  Package cuda-libraries-11-1 is not configured yet.

dpkg: error processing package cuda-toolkit-11-1 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-11-1:
 cuda-11-1 depends on cuda-toolkit-11-1 (>= 11.1.1); however:
  Package cuda-toolkit-11-1 is not configured yet.

dpkg: error processing package cuda-11-1 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-libraries-dev-11-1:
 cuda-libraries-dev-11-1 depends on cuda-nvrtc-dev-11-1 (>= 11.1.105); however:
  Version of cuda-nvrtc-dev-11-1 on system is 11.1.74-1.
 cuda-libraries-dev-11-1 depends on libcublas-dev-11-1 (>= 11.3.0.106); however:
  Version of libcublas-dev-11-1 on system is 11.2.1.74-1.
 cuda-libraries-dev-11-1 depends on libcufft-dev-11-1 (>= 10.3.0.105); however:
  Version of libcufft-dev-11-1 on system is 10.3.0.74-1.
 cuda-libraries-dev-11-1 depends on libcurand-dev-11-1 (>= 10.2.2.105); however:
  Version of libcurand-dev-11-1 on system is 10.2.2.74-1.
 cuda-libraries-dev-11-1 depends on libcusolver-dev-11-1 (>= 11.0.1.105); however:
  Version of libcusolver-dev-11-1 on system is 11.0.0.74-1.
 cuda-libraries-dev-11-1 depends on libcusparse-dev-11-1 (>= 11.3.0.10); however:
  Version of libcusparse-dev-11-1 on system is 11.2.0.275-1.
 cuda-libraries-dev-11-1 depends on libnpp-dev-11-1 (>= 11.1.2.301); however:
  Version of libnpp-dev-11-1 on system is 11.1.1.269-1.
 cuda-libraries-dev-11-1 depends on libnvjpeg-dev-11-1 (>= 11.3.0.105); however:
  Version of libnvjpeg-dev-11-1 on system is 11.2.0.74-1.

dpkg: error processing package cuda-libraries-dev-11-1 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-command-line-tools-11-1:
 cuda-command-line-tools-11-1 depends on cuda-cupti-dev-11-1 (>= 11.1.105); however:
  Version of cuda-cupti-dev-11-1 on system is 11.1.69-1.
 cuda-command-line-tools-11-1 depends on cuda-nvprof-11-1 (>= 11.1.105); however:
  Version of cuda-nvprof-11-1 on system is 11.1.69-1.

dpkg: error processing package cuda-command-line-tools-11-1 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-visual-tools-11-1:
 cuda-visual-tools-11-1 depends on cuda-nvrtc-dev-11-1 (>= 11.1.105); however:
  Version of cuda-nvrtc-dev-11-1 on system is 11.1.74-1.
 cuda-visual-tools-11-1 depends on libcublas-dev-11-1 (>= 11.3.0.106); however:
  Version of libcublas-dev-11-1 on system is 11.2.1.74-1.
 cuda-visual-tools-11-1 depends on libcufft-dev-11-1 (>= 10.3.0.105); however:
  Version of libcufft-dev-11-1 on system is 10.3.0.74-1.
 cuda-visual-tools-11-1 depends on libcurand-dev-11-1 (>= 10.2.2.105); however:
  Version of libcurand-dev-11-1 on system is 10.2.2.74-1.
 cuda-visual-tools-11-1 depends on libcusolver-dev-11-1 (>= 11.0.1.105); however:
  Version of libcusolver-dev-11-1 on system is 11.0.0.74-1.
 cuda-visual-tools-11-1 depends on libcusparse-dev-11-1 (>= 11.3.0.10); however:
  Version of libcusparse-dev-11-1 on system is 11.2.0.275-1.
 cuda-visual-tools-11-1 depends on libnpp-dev-11-1 (>= 11.1.2.301); however:
  Version of libnpp-dev-11-1 on system is 11.1.1.269-1.
 cuda-visual-tools-11-1 depends on libnvjpeg-dev-11-1 (>= 11.3.0.105); however:
  Version of libnvjpeg-dev-11-1 on system is 11.2.0.74-1.

dpkg: error processing package cuda-visual-tools-11-1 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-runtime-11-1:
 cuda-runtime-11-1 depends on cuda-libraries-11-1 (>= 11.1.1); however:
  Package cuda-libraries-11-1 is not configured yet.

dpkg: error processing package cuda-runtime-11-1 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda:
 cuda depends on cuda-11-1 (>= 11.1.1); however:
  Package cuda-11-1 is not configured yet.

dpkg: error processing package cuda (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-tools-11-1:
 cuda-tools-11-1 depends on cuda-command-line-tools-11-1 (>= 11.1.1); however:
  Package cuda-command-line-tools-11-1 is not configured yet.
 cuda-tools-11-1 depends on cuda-visual-tools-11-1 (>= 11.1.1); however:
  Package cuda-visual-tools-11-1 is not configured yet.

dpkg: error processing package cuda-tools-11-1 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 cuda-libraries-11-1
 cuda-compiler-11-1
 cuda-toolkit-11-1
 cuda-11-1
 cuda-libraries-dev-11-1
 cuda-command-line-tools-11-1
 cuda-visual-tools-11-1
 cuda-runtime-11-1
 cuda
 cuda-tools-11-1

然后我尝试使用标志执行干净的 apt 和更新--fix-missing

$ sudo apt clean
$ sudo apt update --fix-missing
Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Ign:4 http://linux.dropbox.com/ubuntu disco InRelease
Get:5 http://linux.dropbox.com/ubuntu disco Release [6,598 B]
Get:6 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Hit:7 http://ppa.launchpad.net/kelleyk/emacs/ubuntu focal InRelease
Get:8 http://linux.dropbox.com/ubuntu disco Release.gpg [473 B]
Get:9 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [264 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [301 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [2,468 B]
Get:12 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [24.2 kB]
Get:13 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [56.6 kB]
Get:14 http://us.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [1,768 B]
Ign:15 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  InRelease
Hit:16 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  Release
Get:18 http://linux.dropbox.com/ubuntu disco/main i386 Packages [1,163 B]
Get:19 http://linux.dropbox.com/ubuntu disco/main amd64 Packages [1,169 B]
Fetched 984 kB in 1s (956 kB/s)
Reading package lists...
Building dependency tree...
Reading state information...
263 packages can be upgraded. Run 'apt list --upgradable' to see them.

这是我尝试全新安装时的输出:

$ sudo apt install -f
Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  g++-8 libaccinj64-10.1 libcublas10 libcublaslt10 libcudart10.1 libcufft10
  libcufftw10 libcuinj64-10.1 libcupti-dev libcupti-doc libcupti10.1
  libcurand10 libcusolver10 libcusolvermg10 libcusparse10 libegl-dev libgl-dev
  libgl1-mesa-dev libgles-dev libgles1 libglvnd-dev libglx-dev libncurses5
  libnppc10 libnppial10 libnppicc10 libnppicom10 libnppidei10 libnppif10
  libnppig10 libnppim10 libnppist10 libnppisu10 libnppitc10 libnpps10
  libnvblas10 libnvgraph10 libnvidia-ml-dev libnvjpeg10 libnvrtc10.1
  libnvtoolsext1 libnvvm3 libopengl-dev libpthread-stubs0-dev libstdc++-8-dev
  libthrust-dev libtinfo5 libvdpau-dev libx11-dev libxau-dev libxcb1-dev
  libxdmcp-dev node-html5shiv nsight-compute-2020.2.0 nvidia-cuda-doc
  nvidia-cuda-gdb nvidia-opencl-dev nvidia-profiler nvidia-visual-profiler
  ocl-icd-opencl-dev opencl-c-headers x11proto-core-dev x11proto-dev
  xorg-sgml-doctools xtrans-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  cuda-cupti-11-1 cuda-cupti-dev-11-1 cuda-nvcc-11-1 cuda-nvprof-11-1
  cuda-nvrtc-11-1 cuda-nvrtc-dev-11-1 libcublas-11-1 libcublas-dev-11-1
  libcufft-11-1 libcufft-dev-11-1 libcurand-11-1 libcurand-dev-11-1
  libcusolver-11-1 libcusolver-dev-11-1 libcusparse-11-1 libcusparse-dev-11-1
  libnpp-11-1 libnpp-dev-11-1 libnvjpeg-11-1 libnvjpeg-dev-11-1
The following packages will be upgraded:
  cuda-cupti-11-1 cuda-cupti-dev-11-1 cuda-nvcc-11-1 cuda-nvprof-11-1
  cuda-nvrtc-11-1 cuda-nvrtc-dev-11-1 libcublas-11-1 libcublas-dev-11-1
  libcufft-11-1 libcufft-dev-11-1 libcurand-11-1 libcurand-dev-11-1
  libcusolver-11-1 libcusolver-dev-11-1 libcusparse-11-1 libcusparse-dev-11-1
  libnpp-11-1 libnpp-dev-11-1 libnvjpeg-11-1 libnvjpeg-dev-11-1
20 upgraded, 0 newly installed, 0 to remove and 243 not upgraded.
10 not fully installed or removed.
Need to get 1,625 MB of archives.
After this operation, 71.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] Get:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  cuda-nvrtc-11-1 11.1.105-1 [11.1 MB]
Get:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libcublas-11-1 11.3.0.106-1 [170 MB]
Get:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libcufft-11-1 10.3.0.105-1 [129 MB]
Get:4 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libcurand-11-1 10.2.2.105-1 [39.6 MB]
Get:5 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libcusolver-11-1 11.0.1.105-1 [399 MB]
Get:6 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libcusparse-11-1 11.3.0.10-1 [103 MB]
Get:7 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libnpp-11-1 11.1.2.301-1 [84.8 MB]
Get:8 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libnvjpeg-11-1 11.3.0.105-1 [1,646 kB]
Get:9 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  cuda-nvcc-11-1 11.1.105-1 [27.0 MB]
Get:10 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  cuda-nvrtc-dev-11-1 11.1.105-1 [22.6 kB]
Get:11 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libcublas-dev-11-1 11.3.0.106-1 [172 MB]
Get:12 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libcufft-dev-11-1 10.3.0.105-1 [221 MB]
Get:13 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libcurand-dev-11-1 10.2.2.105-1 [39.6 MB]
Get:14 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libcusolver-dev-11-1 11.0.1.105-1 [21.8 MB]
Get:15 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libcusparse-dev-11-1 11.3.0.10-1 [104 MB]
Get:16 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libnpp-dev-11-1 11.1.2.301-1 [84.8 MB]
Get:17 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  libnvjpeg-dev-11-1 11.3.0.105-1 [1,576 kB]
Get:18 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  cuda-cupti-11-1 11.1.105-1 [10.9 MB]
Get:19 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  cuda-cupti-dev-11-1 11.1.105-1 [2,294 kB]
Get:20 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  cuda-nvprof-11-1 11.1.105-1 [1,910 kB]
Fetched 1,625 MB in 3min 34s (7,585 kB/s)
(Reading database ... 
dpkg: warning: files list file for package 'cuda-nvtx-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-driver-dev-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'nvidia-cuda-gdb' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-libraries-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-gdb-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-nvrtc-dev-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-documentation-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-nsight-compute-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-memcheck-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-compiler-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-nvprune-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-nvcc-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-nsight-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-drivers-455' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-cudart-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-toolkit-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-demo-suite-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-nvprof-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-drivers' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-nvml-dev-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'nvidia-cuda-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-tools-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcudart10.1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-cupti-dev-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-cuobjdump-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-cudart-dev-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-nvrtc-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-sanitizer-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-libraries-dev-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-cupti-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-samples-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-nvdisasm-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-nsight-systems-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-command-line-tools-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-nvvp-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-visual-tools-11-1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'cuda-runtime-11-1' missing; assuming package has no files currently installed
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 407764 files and directories currently installed.)
Preparing to unpack .../00-cuda-nvrtc-11-1_11.1.105-1_amd64.deb ...
Unpacking cuda-nvrtc-11-1 (11.1.105-1) over (11.1.74-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/00-cuda-nvrtc-11-1_11.1.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/lib64', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../01-libcublas-11-1_11.3.0.106-1_amd64.deb ...
Unpacking libcublas-11-1 (11.3.0.106-1) over (11.2.1.74-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/01-libcublas-11-1_11.3.0.106-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/lib64', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../02-libcufft-11-1_10.3.0.105-1_amd64.deb ...
Unpacking libcufft-11-1 (10.3.0.105-1) over (10.3.0.74-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/02-libcufft-11-1_10.3.0.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/lib64', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../03-libcurand-11-1_10.2.2.105-1_amd64.deb ...
Unpacking libcurand-11-1 (10.2.2.105-1) over (10.2.2.74-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/03-libcurand-11-1_10.2.2.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/lib64', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../04-libcusolver-11-1_11.0.1.105-1_amd64.deb ...
Unpacking libcusolver-11-1 (11.0.1.105-1) over (11.0.0.74-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/04-libcusolver-11-1_11.0.1.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/lib64', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../05-libcusparse-11-1_11.3.0.10-1_amd64.deb ...
Unpacking libcusparse-11-1 (11.3.0.10-1) over (11.2.0.275-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/05-libcusparse-11-1_11.3.0.10-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/lib64', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../06-libnpp-11-1_11.1.2.301-1_amd64.deb ...
Unpacking libnpp-11-1 (11.1.2.301-1) over (11.1.1.269-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/06-libnpp-11-1_11.1.2.301-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/lib64', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../07-libnvjpeg-11-1_11.3.0.105-1_amd64.deb ...
Unpacking libnvjpeg-11-1 (11.3.0.105-1) over (11.2.0.74-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/07-libnvjpeg-11-1_11.3.0.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/lib64', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../08-cuda-nvcc-11-1_11.1.105-1_amd64.deb ...
Unpacking cuda-nvcc-11-1 (11.1.105-1) over (11.1.74-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/08-cuda-nvcc-11-1_11.1.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/include', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../09-cuda-nvrtc-dev-11-1_11.1.105-1_amd64.deb ...
Unpacking cuda-nvrtc-dev-11-1 (11.1.105-1) over (11.1.74-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/09-cuda-nvrtc-dev-11-1_11.1.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/include', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../10-libcublas-dev-11-1_11.3.0.106-1_amd64.deb ...
Unpacking libcublas-dev-11-1 (11.3.0.106-1) over (11.2.1.74-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/10-libcublas-dev-11-1_11.3.0.106-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/include', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../11-libcufft-dev-11-1_10.3.0.105-1_amd64.deb ...
Unpacking libcufft-dev-11-1 (10.3.0.105-1) over (10.3.0.74-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/11-libcufft-dev-11-1_10.3.0.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/include', which is also in package libcurand-dev-11-1 10.2.2.74-1
Preparing to unpack .../12-libcurand-dev-11-1_10.2.2.105-1_amd64.deb ...
Unpacking libcurand-dev-11-1 (10.2.2.105-1) over (10.2.2.74-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/12-libcurand-dev-11-1_10.2.2.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/include', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../13-libcusolver-dev-11-1_11.0.1.105-1_amd64.deb ...
Unpacking libcusolver-dev-11-1 (11.0.1.105-1) over (11.0.0.74-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/13-libcusolver-dev-11-1_11.0.1.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/include', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../14-libcusparse-dev-11-1_11.3.0.10-1_amd64.deb ...
Unpacking libcusparse-dev-11-1 (11.3.0.10-1) over (11.2.0.275-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/14-libcusparse-dev-11-1_11.3.0.10-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/include', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../15-libnpp-dev-11-1_11.1.2.301-1_amd64.deb ...
Unpacking libnpp-dev-11-1 (11.1.2.301-1) over (11.1.1.269-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/15-libnpp-dev-11-1_11.1.2.301-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/include', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../16-libnvjpeg-dev-11-1_11.3.0.105-1_amd64.deb ...
Unpacking libnvjpeg-dev-11-1 (11.3.0.105-1) over (11.2.0.74-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/16-libnvjpeg-dev-11-1_11.3.0.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/include', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../17-cuda-cupti-11-1_11.1.105-1_amd64.deb ...
Unpacking cuda-cupti-11-1 (11.1.105-1) over (11.1.69-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/17-cuda-cupti-11-1_11.1.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/lib64', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../18-cuda-cupti-dev-11-1_11.1.105-1_amd64.deb ...
Unpacking cuda-cupti-dev-11-1 (11.1.105-1) over (11.1.69-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/18-cuda-cupti-dev-11-1_11.1.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/include', which is also in package libcufft-dev-11-1 10.3.0.74-1
Preparing to unpack .../19-cuda-nvprof-11-1_11.1.105-1_amd64.deb ...
Unpacking cuda-nvprof-11-1 (11.1.105-1) over (11.1.69-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-IIS0l5/19-cuda-nvprof-11-1_11.1.105-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-11.1/include', which is also in package libcufft-dev-11-1 10.3.0.74-1
Errors were encountered while processing:
 /tmp/apt-dpkg-install-IIS0l5/00-cuda-nvrtc-11-1_11.1.105-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/01-libcublas-11-1_11.3.0.106-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/02-libcufft-11-1_10.3.0.105-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/03-libcurand-11-1_10.2.2.105-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/04-libcusolver-11-1_11.0.1.105-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/05-libcusparse-11-1_11.3.0.10-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/06-libnpp-11-1_11.1.2.301-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/07-libnvjpeg-11-1_11.3.0.105-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/08-cuda-nvcc-11-1_11.1.105-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/09-cuda-nvrtc-dev-11-1_11.1.105-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/10-libcublas-dev-11-1_11.3.0.106-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/11-libcufft-dev-11-1_10.3.0.105-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/12-libcurand-dev-11-1_10.2.2.105-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/13-libcusolver-dev-11-1_11.0.1.105-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/14-libcusparse-dev-11-1_11.3.0.10-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/15-libnpp-dev-11-1_11.1.2.301-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/16-libnvjpeg-dev-11-1_11.3.0.105-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/17-cuda-cupti-11-1_11.1.105-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/18-cuda-cupti-dev-11-1_11.1.105-1_amd64.deb
 /tmp/apt-dpkg-install-IIS0l5/19-cuda-nvprof-11-1_11.1.105-1_amd64.deb

答案1

为了解决这个问题:

  1. /etc/apt/sources.list禁用和 下的第三方存储库/etc/apt/sources.list.d/。仅保留常规 Ubuntu 存储库。

  2. 备份您的status文件:

    sudo cp /var/lib/dpkg/status /var/lib/dpkg/status.bak

然后编辑您的,/var/lib/dpkg/status删除导致问题的软件包及其描述。(cuda-nvrtc==> cuda-nvprof

然后运行:

sudo dpkg --configure -a
sudo apt update
sudo apt upgrade
  1. 要安装,cuda请按照官方文档

相关内容