未满足的依赖关系。尝试“apt-get -f install”

未满足的依赖关系。尝试“apt-get -f install”

cuda-10.0当我尝试使用本文中提到的以下方法从系统中卸载该工具包时,出现了问题线来自用户271219。

1)我的 Nvidia 驱动程序

$ cat /proc/driver/nvidia/version

NVRM version: NVIDIA UNIX x86_64 Kernel Module  387.26  Thu Nov  2 21:20:16 PDT 2017
GCC version:  gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)

2)尝试删除cuda-10-0

$ sudo apt-get purge cuda-10-0 

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 cuda-cudart-dev-10-0 : Depends: cuda-driver-dev-10-0 (>= 10.0.130) but it is not going to be installed
 cuda-libraries-dev-10-0 : Depends: cuda-driver-dev-10-0 (>= 10.0.130) but it is not going to be installed
 cuda-samples-10-0 : Depends: cuda-driver-dev-10-0 but it is not going to be installed
 cuda-toolkit-10-0 : Depends: cuda-nvml-dev-10-0 (>= 10.0.130) but it is not going to be installed
 cuda-visual-tools-10-0 : Depends: cuda-driver-dev-10-0 (>= 10.0.130) but it is not going to be installed
                          Depends: cuda-nvml-dev-10-0 (>= 10.0.130) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

3)强制apt-get

$ sudo apt-get install -f

The following additional packages will be installed:
  cuda-driver-dev-10-0 cuda-nvml-dev-10-0
The following NEW packages will be installed:
  cuda-driver-dev-10-0 cuda-nvml-dev-10-0
0 upgraded, 2 newly installed, 0 to remove and 189 not upgraded.
10 not fully installed or removed.
Need to get 0 B/63.5 kB of archives.
After this operation, 556 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 file:/var/cuda-repo-10-0-local-10.0.130-410.48  cuda-driver-dev-10-0 10.0.130-1 [12.0 kB]
Get:2 file:/var/cuda-repo-10-0-local-10.0.130-410.48  cuda-nvml-dev-10-0 10.0.130-1 [51.6 kB]
(Reading database ... 123484 files and directories currently installed.)
Preparing to unpack .../cuda-driver-dev-10-0_10.0.130-1_amd64.deb ...
Unpacking cuda-driver-dev-10-0 (10.0.130-1) ...
dpkg: error processing archive /var/cuda-repo-10-0-local-10.0.130-410.48/./cuda-driver-dev-10-0_10.0.130-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-10.0/lib64', which is also in package cuda-npp-10-0 10.0.130-1
Preparing to unpack .../cuda-nvml-dev-10-0_10.0.130-1_amd64.deb ...
Unpacking cuda-nvml-dev-10-0 (10.0.130-1) ...
dpkg: error processing archive /var/cuda-repo-10-0-local-10.0.130-410.48/./cuda-nvml-dev-10-0_10.0.130-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-10.0/lib64', which is also in package cuda-npp-10-0 10.0.130-1
Errors were encountered while processing:
 /var/cuda-repo-10-0-local-10.0.130-410.48/./cuda-driver-dev-10-0_10.0.130-1_amd64.deb
 /var/cuda-repo-10-0-local-10.0.130-410.48/./cuda-nvml-dev-10-0_10.0.130-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我想清除系统中的当前cuda文件并重新安装它。

答案1

我删除了与 cuda 相关的存储库

$ rm /etc/apt/sources.list.d/cuda*

使用更新存储库apt-get update

清除所有与 cuda 相关的文件

$ sudo apt-get --purge remove cuda*
$ sudo apt-get autoremove

问题解决了。

相关内容