每次我尝试安装 vim 时,都会遇到这个奇怪的问题:
The following packages have unmet dependencies:
cuda-libraries-dev-10-1 : Depends: libcublas-dev (>= 10.2.0.168) but it is not going to be installed
cuda-samples-10-1 : Depends: libcublas-dev (>= 10.2.0.168) but it is not going to be installed
cuda-visual-tools-10-1 : Depends: libcublas-dev (>= 10.2.0.168) but it is not going to be installed
vim : Depends: vim-runtime (= 2:8.0.1453-1ubuntu1.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
坦白说,我把 CUDA 安装得一团糟,所以我想知道这些消息是否意味着我弄坏了什么东西。如果不是,为什么 vim 无法安装?
以下是 sudo apt--fix-broken install 的输出
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
g++-6 libaccinj64-9.1 libcublas9.1 libcudart9.1 libcufft9.1 libcufftw9.1 libcuinj64-9.1 libcurand9.1
libcusolver9.1 libcusparse9.1 libnppc9.1 libnppial9.1 libnppicc9.1 libnppicom9.1 libnppidei9.1
libnppif9.1 libnppig9.1 libnppim9.1 libnppist9.1 libnppisu9.1 libnppitc9.1 libnpps9.1 libnvblas9.1
libnvgraph9.1 libnvrtc9.1 libnvtoolsext1 libnvvm3 libstdc++-6-dev libthrust-dev libvdpau-dev
nvidia-cuda-dev nvidia-cuda-doc nvidia-cuda-gdb nvidia-opencl-dev nvidia-profiler
nvidia-visual-profiler ocl-icd-opencl-dev opencl-c-headers openjdk-8-jre
Use 'sudo apt autoremove' to remove them.
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 53 not upgraded.
35 not fully installed or removed.
Need to get 0 B/39.1 MB of archives.
After this operation, 112 MB of additional disk space will be used.
答案1
Vim 应该能够在没有 CUDA 包的情况下安装,因此运行以下命令进行安装vim
:
sudo apt update
sudo apt install vim-common vim-runtime vim
请发布任何错误。谢谢!
更新:
因为你有:
35 未完全安装或删除。
解决这个问题的方法通常是:
sudo dpkg --configure -a
此外,似乎不会通过安装依赖项来破坏任何东西,因为依赖项是唯一提到的需要进行的更改。
未满足的依赖项的修复通常是安装未满足的依赖项,然后运行更新和升级:
sudo apt clean
sudo apt update
sudo apt install libcublas-dev
如果系统抱怨另一个依赖项,只需先使用相同方法安装该依赖项,然后安装libcublas-dev
。