安装时CUDA出错,求助卸载

安装时CUDA出错,求助卸载

我的工作中使用 Blender,我将 Ubuntu 升级到了 18.04。升级后,我安装了 CUDA 工具包,但现在我收到有关依赖项的错误,我想删除所有已安装的内容。我该怎么做?

mehman@HP:/opt$ sudo apt autoremove 
Reading package lists...
Done Building dependency tree       
Reading state information...
Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies:  libcuinj64-9.1 : Depends: libcuda1 (>= 387.26) but it is not installable or
                           libcuda-9.1-1 E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

mehman@HP:~$ 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 libcufft9.1 libcufftw9.1 libcuinj64-9.1
  libcurand9.1 libcusolver9.1 libcusparse9.1 libdrm-dev libgl1-mesa-dev
  libglvnd-core-dev libglvnd-dev 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 libopengl0 libpthread-stubs0-dev libstdc++-6-dev
  libthrust-dev libvdpau-dev libx11-dev libx11-doc libx11-xcb-dev libxau-dev
  libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev
  libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev
  libxcb-xfixes0-dev libxcb1-dev libxdamage-dev libxdmcp-dev libxext-dev
  libxfixes-dev libxshmfence-dev libxxf86vm-dev mesa-common-dev
  ocl-icd-opencl-dev opencl-c-headers x11proto-core-dev x11proto-damage-dev
  x11proto-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev
  x11proto-xext-dev x11proto-xf86vidmode-dev xorg-sgml-doctools xtrans-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libnvidia-compute-390
The following NEW packages will be installed:
  libnvidia-compute-390
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
73 not fully installed or removed.
Need to get 0 B/20,6 MB of archives.
After this operation, 85,8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 341821 files and directories currently installed.)
Preparing to unpack .../libnvidia-compute-390_390.48-0ubuntu3_amd64.deb ...
Unpacking libnvidia-compute-390:amd64 (390.48-0ubuntu3) ...
dpkg: error processing archive /var/cache/apt/archives/libnvidia-compute-390_390.48-0ubuntu3_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libnvidia-ml.so', which is also in package nvidia-340 340.106-0ubuntu3
Errors were encountered while processing:
 /var/cache/apt/archives/libnvidia-compute-390_390.48-0ubuntu3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
mehman@HP:

答案1

CUDA 想要使用的驱动程序 (nvidia-390) 与您安装的驱动程序之间存在冲突。我遇到了同样的问题:"which is also in package nvidia-340..."对我来说,这个问题通过首先清除旧的 nvidia 驱动程序来解决

sudo dpkg -P nvidia-340

只有这样

sudo apt --fix-broken install

工作。您可以通过以下方式清除所有内容

sudo apt purge nvidia*

sudo apt purge cuda*

您可以继续获取较新的 nvidia 驱动程序

sudo apt install nvidia-390 nvidia-390-dev

安装nvidia-384驱动程序也应该可行,但我不确定。

答案2

sudo apt-get -o Dpkg::Options::="--force-overwrite" install --fix-broken 这也对我有用 hp laptop amd ryzen 5000 series

答案3

这对我有用

sudo apt-get -o Dpkg::Options::="--force-overwrite" install --fix-broken

相关内容