Not able to uninstall CUDA 10.1 on Ubuntu 16.04.6 LTS

Not able to uninstall CUDA 10.1 on Ubuntu 16.04.6 LTS

我正在尝试卸载 Ubuntu 16.04.6 LTS 上的 Cuda 10.1,但无法使用 nvidia 网站上给出的说明来卸载它。

我已经按照此处给出的说明在 Ubuntu 16.04.6 LTS 上安装了 CUDA 10.1https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ubuntu-installation. I performed the installation using deb(local), i.e. using package manager. I followed installation instructions given here: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal.

Now I am trying to uninstall Cuda 10.1 as I realized Cuda 10.1 is not compatible with tensorflow 1.13. I tried the uninstalling by running the command

sudo apt-get --purge remove <package_name>

which is mentioned here: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#handle-uninstallation. Moreover I am not sure what should be the package_name in the above command. I tried with the package_name as https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal but that did not perform the uninstallation and by running the command I get below log

[1] 2314
[2] 2315
[3] 2316
[4] 2317
[2]   Done                    target_arch=x86_64
[3]-  Done                    target_distro=Ubuntu
[4]+  Done                    target_version=1604
Reading package lists... Doneloads$
Building dependency tree
Reading state information... Done
E: Unable to locate package https://developer.nvidia.com/cuda-downloads?target_os
E: Couldn't find any package by glob 'https://developer.nvidia.com/cuda-downloads?target_os'
E: Couldn't find any package by regex 'https://developer.nvidia.com/cuda-downloads?target_os'

But this does not perform uninstallation of Cuda 10.1. I still see Cuda-10.1 in /usr/local.

If someone can tell me where I am going wrong or what is correct forum to ask this question. I am new to linux environment so if I am wrong with some terminology, please correct me.

答案1

This question pops up in my google search about removing cuda toolkit for ubuntu 16.04. Though this might be too late, but it might help others. So...

I read the pages you linked (which are very helpful) and did the following. These commands seem to remove cuda 10.1 on my ubuntu 16.04 machine.

sudo apt --purge remove cuda-10.1
sudo apt autoremove
sudo apt autoclean

After these commands, about 4 - 5 GB files are removed. But like what you said, I also find there is still a directory /usr/local/cuda-10.1 remaining. Upon further checking, I see that much content in this directory has already been removed. So I just did the remove like the following line.

sudo rm -rf /usr/local/cuda-10.1

Hope this helps someone.

相关内容