# Can not install cudnn in Ubuntu2204 with cuda 12.1

**URL:** <https://forums.developer.nvidia.com/t/can-not-install-cudnn-in-ubuntu2204-with-cuda-12-1/273367>\
**Category:** CUDA Setup and Installation\
**Tags:** cudnn\
**Created:** [November 19, 2023, 7:25am UTC](https://forums.developer.nvidia.com/t/can-not-install-cudnn-in-ubuntu2204-with-cuda-12-1/273367 "2023-11-19T07:25:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cwwu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cwwu](https://forums.developer.nvidia.com/u/cwwu)\
**Post date:** [November 19, 2023, 7:25am UTC](https://forums.developer.nvidia.com/t/can-not-install-cudnn-in-ubuntu2204-with-cuda-12-1/273367/1 "2023-11-19T07:25:49Z")

</div>

Hi,  
I am downloading the cuda12.1 in my ubuntu2204, and it works:

```auto
XXX@XXX:~/XXX$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Mon_Apr__3_17:16:06_PDT_2023
Cuda compilation tools, release 12.1, V12.1.105
Build cuda_12.1.r12.1/compiler.32688072_0

```

However when I follow the guide of cudnn installation in [cudnn-installation](https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html), Something goes wrong when I run the code `sudo apt-get install libcudnn8=8.9.6.50-1+cuda12.1`  
it said "can not find the version of “8.9.6.50-1+cuda12.1”

8.9.6.50-1+cuda12.1

---

<div class="post-metadata">

**Author:** ![cwwu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cwwu](https://forums.developer.nvidia.com/u/cwwu)\
**Post date:** [November 19, 2023, 8:10am UTC](https://forums.developer.nvidia.com/t/can-not-install-cudnn-in-ubuntu2204-with-cuda-12-1/273367/2 "2023-11-19T08:10:38Z")

</div>

I solved this by using `sudo apt-get install libcudnn8=8.9.6.50-1+cuda12.2`. And this pass the cudnn test. I think this is because that cudnn+cuda12.2 can be compatible with cudnn-cuda12.1.  
I find this through the previous command `sudo apt-get update`, executing this command then it outputs something like “file: /var/cudnn…”, I step into this folder and find that there are `deb` files which name contain cuda-12.2, So I have a try and it succeeds.
