安装时出现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: 

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驱动程序也应该可以工作,但我不确定。