![dpkg:处理存档 /var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb (--unpack) 时出错](https://linux22.com/image/1155509/dpkg%EF%BC%9A%E5%A4%84%E7%90%86%E5%AD%98%E6%A1%A3%20%2Fvar%2Fcache%2Fapt%2Farchives%2Fcuda-cublas-9-1_9.1.85.3-1_amd64.deb%20(--unpack)%20%E6%97%B6%E5%87%BA%E9%94%99%20.png)
当我运行 sudo apt-get -f install 时,它显示 dpkg:错误处理。请查看下面的完整日志并建议如何解决此问题。我应该删除旧版本吗?
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
cuda-cublas-9-1
The following packages will be upgraded:
cuda-cublas-9-1
1 upgraded, 0 newly installed, 0 to remove and 553 not upgraded.
1 not fully installed or removed.
Need to get 50.1 MB of archives.
After this operation, 56.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 cuda-cublas-9-1 9.1.85.3-1 [50.1 MB]
Fetched 50.1 MB in 21s (2,313 kB/s)
(Reading database ... 415420 files and directories currently installed.)
Preparing to unpack .../cuda-cublas-9-1_9.1.85.3-1_amd64.deb ...
Unpacking cuda-cublas-9-1 (9.1.85.3-1) over (9.1.85-1) ...
dpkg: error processing archive /var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
Errors were encountered while processing:
/var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
您收到的错误是:
dpkg: error processing archive /var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb (--unpack):
trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1
这 ”试图覆盖“错误意味着您的系统中存在冲突的软件包。您可以尝试覆盖该软件包(可能有点冒险)
sudo dpkg -i --force-overwrite /var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb You need to remove that package
如果这不能解决问题,您可以删除该包并重新安装
sudo dpkg -P cuda-cublas