如何从Ubuntu上完全删除Cuda? [英] How to remove cuda completely from ubuntu?

查看:359
本文介绍了如何从Ubuntu上完全删除Cuda?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有ubuntu 18.04,并意外安装了cuda 9.1来运行Tensorflow-gpu,但似乎tensorflow-gpu需要cuda 10.0,所以我想先执行以下命令来删除cuda:

I have ubuntu 18.04, and accidentally installed cuda 9.1 to run Tensorflow-gpu, but it seems tensorflow-gpu requires cuda 10.0, so I want to remove cuda first by executing:

martin@nlp-server:~$ sudo apt-get remove --auto-remove nvidia-cuda-toolkit
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:
 cuda-libraries-dev-10-1 : Depends: libcublas-dev (>= 10.2.0.168) but 10.1.0.105-1 is to be installed
 cuda-samples-10-1 : Depends: libcublas-dev (>= 10.2.0.168) but 10.1.0.105-1 is to be installed
 cuda-visual-tools-10-1 : Depends: libcublas-dev (>= 10.2.0.168) but 10.1.0.105-1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

然后我尝试运行"apt --fix-broken install",但出现以下错误:

Then I tried to run 'apt --fix-broken install', but got the following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libcublas-dev
The following packages will be upgraded:
  libcublas-dev
1 upgraded, 0 newly installed, 0 to remove and 145 not upgraded.
69 not fully installed or removed.
Need to get 0 B/39.1 MB of archives.
After this operation, 3,458 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 253408 files and directories currently installed.)
Preparing to unpack .../libcublas-dev_10.2.0.168-1_amd64.deb ...

Unpacking libcublas-dev (10.2.0.168-1) over (10.1.0.105-1) .........................................................................................................................................................................................................................................................] 
dpkg: error processing archive /var/cache/apt/archives/libcublas-dev_10.2.0.168-1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libcublas_static.a', which is also in package nvidia-cuda-dev 9.1.85-3ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libcublas-dev_10.2.0.168-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

如何完全删除cuda?

How to remove cuda completely?

推荐答案

我如下解决了这个问题:

I solved this issue as follow :

sudo apt-get purge nvidia*
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /usr/local/cuda*

这将完成工作.

这篇关于如何从Ubuntu上完全删除Cuda?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆