每当我尝试安装某些东西时,都会出现以下错误:
The following packages have unmet dependencies:
cuda-samples-8.0 : Depends: cuda-cufft-dev-8-0 but it is not going to be installed
cuda-toolkit-8.0 : Depends: cuda-cufft-dev-8-0 but it is not going to be installed
cuda-visual-tools-8.0 : Depends: cuda-cufft-dev-8-0 but it is not going to be installed
我尝试了一下sudo apt-get -f install
,它说:
The following packages were automatically installed and are no longer required:
[lots of cuda 7.5 packages and some other linux ones like linux-image-4.2.0-27-generic]
The following extra packages will be installed:
cuda-cufft-dev-8-0
The following NEW packages will be installed:
cuda-cufft-dev-8-0
Do you want to continue?
我告诉它继续,但出现此错误:
(Reading database ... 731426 files and directories currently installed.)
Preparing to unpack .../cuda-cufft-dev-8-0_8.0.61-1_amd64.deb ...
Unpacking cuda-cufft-dev-8-0 (8.0.61-1) ...
dpkg-deb (subprocess): decompressing archive member: internal gzip read error: '<fd:4>: incorrect data check'
dpkg-deb: error: subprocess <decompress> returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/cuda-cufft-dev-8-0_8.0.61-1_amd64.deb (--unpack):
cannot copy extracted data for './usr/local/cuda-8.0/targets/x86_64-linux/lib/libcufft_static.a' to '/usr/local/cuda-8.0/targets/x86_64-linux/lib/libcufft_static.a.dpkg-new': unexpected end of file or stream
Errors were encountered while processing:
/var/cache/apt/archives/cuda-cufft-dev-8-0_8.0.61-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我尝试修复这个问题一段时间,但没能成功,所以最后我开始尝试卸载 cuda。在 /usr/local/ 中,我看到了 cuda、cuda-7.5 和 cuda-8.0(这可能不太好)。我进入所有目录寻找卸载文件(/usr/local/cuda-6.5/bin/uninstall_cuda_7.5.pl),但没有看到任何文件。
我希望升级到最新版本,但目前我也很乐意卸载它。我下一步该怎么做?
当我运行 sudo dpkg --configure -a 时我得到:
dpkg: dependency problems prevent configuration of cuda-toolkit-8-0:
cuda-toolkit-8-0 depends on cuda-cufft-dev-8-0 (>= 8.0.61); however:
Package cuda-cufft-dev-8-0 is not installed.
dpkg: error processing package cuda-toolkit-8-0 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-visual-tools-8-0:
cuda-visual-tools-8-0 depends on cuda-cufft-dev-8-0; however:
Package cuda-cufft-dev-8-0 is not installed.
dpkg: error processing package cuda-visual-tools-8-0 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-samples-8-0:
cuda-samples-8-0 depends on cuda-cufft-dev-8-0; however:
Package cuda-cufft-dev-8-0 is not installed.
dpkg: error processing package cuda-samples-8-0 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-8-0:
cuda-8-0 depends on cuda-toolkit-8-0 (>= 8.0.61); however:
Package cuda-toolkit-8-0 is not configured yet.
dpkg: error processing package cuda-8-0 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-documentation-8-0:
cuda-documentation-8-0 depends on cuda-samples-8-0; however:
Package cuda-samples-8-0 is not configured yet.
dpkg: error processing package cuda-documentation-8-0 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda:
cuda depends on cuda-8-0 (>= 8.0.61); however:
Package cuda-8-0 is not configured yet.
dpkg: error processing package cuda (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
cuda-toolkit-8-0
cuda-visual-tools-8-0
cuda-samples-8-0
cuda-8-0
cuda-documentation-8-0
cuda
答案1
清理缓存后,你可以尝试这些,
dpkg -l | grep cuda- | awk '{print $2}' | xargs -n1 sudo dpkg --purge
df -h
sudo apt-get purge nvidia*
sudo apt-get -f install
sudo apt autoremove
希望这能帮到你。谢谢
答案2
我只需要清理缓存。最终效果如下:
sudo dpkg --configure -a
sudo apt-get clean