我正在使用以下方式在 Ubuntu 20.04 上安装 CUDA 11
sudo apt-get -y install cuda
它给了我以下错误。
Reading package lists... Done
Building dependency tree
Reading state information... Done
cuda is already the newest version (11.0.3-1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
cuda-drivers-450 : Depends: libnvidia-common-450 (>= 450.51.06) but it is not going to be installed
libnvidia-gl-450 : Depends: libnvidia-common-450 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
为了安装 libnvidia-common-450,我使用了sudo apt-get install libnvidia-common-450
输出如下:
dpkg: error processing archive /var/cache/apt/archives/libnvidia-common-450_450.51.06-0ubuntu1_all.deb (--unpack):
trying to overwrite '/usr/share/nvidia/nvidia-application-profiles-450.51.06-key-documentation', which is also in package libnvidia-common-450-server 450.51.06-0ubuntu0.20.04.2
Errors were encountered while processing:
/var/cache/apt/archives/libnvidia-common-450_450.51.06-0ubuntu1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我从 Nvidia 下载了安装程序,但安装时出现同样的错误。有人能帮忙解决这个问题吗?谢谢
答案1
类似这个问题:https://forums.developer.nvidia.com/t/problem-with-apt-and-nvidia-440-on-ubuntu-20-04/115281/2
可以通过运行解决:
$ sudo dpkg -i --force-overwrite /var/cache/apt/archives/libnvidia-common-450_450.51.06-0ubuntu1_all.deb
$ sudo apt --fix-broken install