以下是我现在尝试在 Ubuntu 上安装任何东西时收到的消息。
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.1.0.105) but it is not going to be installed
cuda-samples-10-1 : Depends: libcublas-dev (>= 10.1.0.105) but it is not going to be installed
cuda-visual-tools-10-1 : Depends: libcublas-dev (>= 10.1.0.105) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
我试过了apt --fix-broken install
,我试过了purge
,我试过了sudo apt install -f
,而且sudo apt-get remove --purge '^nvidia-.*'
我什么也做不了。这一切都失败了。
我厌倦了在恢复模式下重新启动以尝试卸载驱动程序。
这是我的输出apt --fix-broken install
:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
libnvidia-common-390
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
libcublas-dev
The following NEW packages will be installed:
libcublas-dev
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
8 not fully installed or removed.
Need to get 0 B/39.9 MB of archives.
After this operation, 115 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 735451 files and directories currently installed.)
Preparing to unpack .../libcublas-dev_10.1.0.105-1_amd64.deb ...
Unpacking libcublas-dev (10.1.0.105-1) ...
dpkg: error processing archive /var/cache/apt/archives/libcublas-dev_10.1.0.105-1_amd64.deb (--unpack):
trying to overwrite '/usr/include/cublas_v2.h', 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/cache/apt/archives/libcublas-dev_10.1.0.105-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
有人可以帮帮我吗?我一直在花费数小时试图解决这个问题。我尝试cuda 10.1
与已经存在的cuda 9.1
. 结果证明这是一个错误。我的旧 cuda 安装工作正常,但dpkg
完全坏了,它不再工作了。
没有卸载之前版本的cuda,我直接尝试安装10.1版本(误操作)。我尝试按照此处给出的链接进行安装:https ://developer.nvidia.com/cuda-downloads 。我选择了:Linux -> x86_64 -> Ubuntu -> 18.04 -> deb(network)
然后我按照那边的说明进行操作。
因此,我无法安装任何东西。
好的,要退出此操作,请运行以下命令:
这将卸载您下载并安装的 nvidia 存储库,并希望系统现在能够自行修复。如果没有,我们可以按照错误消息相当容易地手动修复它。
您可能需要进行更多清除,我们可能不得不
dpkg
手动执行此操作,因此请发布更多错误。谢谢!在我的情况下,删除导致碰撞的包解决了这个问题。
我不得不在文件/etc/apt/sources.list中注释掉以下行
然后运行
这解决了通过尝试按照Nvidia 说明在 Ubuntu 18.04 上安装CUDA Toolkit 10.2 下载而产生的损坏的包管理器问题