当我需要使用 apt-get 安装某些东西时。
$sudo apt-get install autoconf automake libtool curl make g++ unzip
Reading package lists... Done
Building dependency tree
Reading state information... Done
make is already the newest version (4.1-9.1ubuntu1).
unzip is already the newest version (6.0-21ubuntu1).
unzip set to manually installed.
curl is already the newest version (7.58.0-2ubuntu3.8).
g++ is already the newest version (4:7.4.0-1ubuntu2.3).
g++ set to manually installed.
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
autoconf : Depends: m4 (>= 1.4.13)
automake : Depends: autotools-dev (>= 20020320.1) but it is not going to be installed
libtool : Depends: autotools-dev but it is not going to be installed
Recommends: libltdl-dev but it is not going to be installed
nvidia-cuda-toolkit : Depends: nvidia-cuda-dev (= 9.1.85-3ubuntu1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
收到此错误消息后,我尝试修复它。
但是,当我输入“sudo apt --fix-broken install”时,我在下面收到了这个错误。
$sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
nvidia-cuda-dev
Recommended packages:
libnvcuvid1
The following NEW packages will be installed:
nvidia-cuda-dev
0 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
38 not fully installed or removed.
Need to get 0 B/263 MB of archives.
After this operation, 734 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 222357 files and directories currently installed.)
Preparing to unpack .../nvidia-cuda-dev_9.1.85-3ubuntu1_amd64.deb ...
Unpacking nvidia-cuda-dev (9.1.85-3ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/nvidia-cuda-dev_9.1.85-3ubuntu1_amd64.deb (--unpack):
trying to overwrite '/usr/include/cublas.h', which is also in package libcublas-dev 10.2.2.89-1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/nvidia-cuda-dev_9.1.85-3ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
在这里,关于 nvidia-cuda-dev,我已经多次遇到过这个问题。我安装了 cuda 10.2 版本。但我不知道它为什么要使用版本 9?但是我需要这个版本(10.2),我不想改变它,我害怕我的环境会出错。
$nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:24:38_PDT_2019
Cuda compilation tools, release 10.2, V10.2.89
对不起,我不熟悉这里的环境设置。对这种情况有什么建议吗?
非常感谢!
软件包
nvidia-cuda-toolkit
取决于nvidia-cuda-dev
.nvidia-cuda-dev
包含/usr/include/cublas.h
也在包中的文件,libcublas-dev
因此只能同时安装这两个包中的一个,目前是libcublas-dev
.所以基本上你可以有一个
nvidia-cuda-toolkit
或libcublas-dev
但不能两者兼有。删除其中之一。它似乎
libcublas-dev
是为另一个发行版或 Ubuntu 版本制作的,与 Ubuntu 18.04 不兼容。