# Installing cuda toolkit 11.2 returns "Existing installation of CUDA Toolkit 11.2 found" despite supposably completely removed cuda

**URL:** <https://forums.developer.nvidia.com/t/installing-cuda-toolkit-11-2-returns-existing-installation-of-cuda-toolkit-11-2-found-despite-supposably-completely-removed-cuda/210745>\
**Category:** CUDA Setup and Installation\
**Tags:** installation, ubuntu, cuda\
**Created:** [April 10, 2022, 12:17am UTC](https://forums.developer.nvidia.com/t/installing-cuda-toolkit-11-2-returns-existing-installation-of-cuda-toolkit-11-2-found-despite-supposably-completely-removed-cuda/210745 "2022-04-10T00:17:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fdls2011](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@fdls2011](https://forums.developer.nvidia.com/u/fdls2011)\
**Post date:** [April 10, 2022, 12:17am UTC](https://forums.developer.nvidia.com/t/installing-cuda-toolkit-11-2-returns-existing-installation-of-cuda-toolkit-11-2-found-despite-supposably-completely-removed-cuda/210745/1 "2022-04-10T00:17:52Z")

</div>

I am trying to re-install cuda toolkit 11.2 on my Ubuntu 18.04 server. To remove the previous installation, I tried the following commands:

```auto
sudo apt-get --purge remove nvidia-*
sudo apt-get --purge remove "*nvidia*"
sudo apt autoremove cuda
sudo apt-get --purge remove "*cublas*" "cuda*" "nsight*" 
sudo apt-get update 
sudo reboot

```

However, after rebooting, when I tried to install cuda toolkit 11.2 using

```auto
sudo sh cuda_11.2.0_460.27.04_linux.run

```

It returns “Existing installation of CUDA Toolkit 11.2 found”. Also, running “nvidia-smi” and “nvcc -V” seems as if they are functioning properly, and it seems all files in the installation directory of the previous cuda have not been removed. How should I resolve this problem? Thanks!

---

<div class="post-metadata">

**Author:** ![mikaelf](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mikaelf](https://forums.developer.nvidia.com/u/mikaelf)\
**Post date:** [April 14, 2022, 11:23pm UTC](https://forums.developer.nvidia.com/t/installing-cuda-toolkit-11-2-returns-existing-installation-of-cuda-toolkit-11-2-found-despite-supposably-completely-removed-cuda/210745/2 "2022-04-14T23:23:23Z")

</div>

> [@fdls2011](#):
>
> ```auto
> sudo apt-get --purge remove nvidia-*
> sudo apt-get --purge remove "*nvidia*"
> 
> ```

You were trying to remove the driver (despite incomplete steps).

> [@fdls2011](#):
>
> ```auto
> sudo apt autoremove cuda
> sudo apt-get --purge remove "*cublas*" "cuda*" "nsight*"
> 
> ```

You were trying to remove CUDA (despite incorrect order of command).

Recommended steps:

1. Check installed driver version with dpkg -l | grep nvidia
2. Check installed cuda version with dkpg -l | grep cuda
3. Check if current driver version is still compatible with cuda version you want to install ([compiled compatibility table](https://tech.amikelive.com/node-930/cuda-compatibility-of-nvidia-display-gpu-drivers/) as a quick reference)
4. In case of compatible driver, remove old version of cuda and install the target cuda version
5. In case of incompatible driver, upgrade driver, remove old version of cuda and install the target cuda version

---

<div class="post-metadata">

**Author:** ![annz](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@annz](https://forums.developer.nvidia.com/u/annz)\
**Post date:** [February 19, 2024, 9:58am UTC](https://forums.developer.nvidia.com/t/installing-cuda-toolkit-11-2-returns-existing-installation-of-cuda-toolkit-11-2-found-despite-supposably-completely-removed-cuda/210745/3 "2024-02-19T09:58:16Z")

</div>

It is really good suggestion to check its compatibly. And upgrading driver is more easier than remove/install target cuda version :) It works.
