cuDNN install fails on Ubuntu 22.04, installing from .deb file

Installing cuDNN from deb file on Ubuntu 22.04
cuda installation already done, and verified

following the steps, once you have install of deb file for cuDNN
install: (cuDNN) toolkit, samples, docs

My paste-dump below is a mix of my notes but clearly shows the commands and the output.
I’m New to this, but can see the error, How to fix run cleanly ?
TIA - for any assistance or guide to help

1.3.2. Debian Local Installation

Download the Debian local repository installation package. Before issuing the following commands, you must replace X.Y and 8.x.x.x with your specific CUDA and cuDNN versions.

X.Y 12.2
8.x.x.x 8.9.3.28

sudo apt-get install libcudnn8=8.x.x.x-1+cudaX.Y
sudo apt-get install libcudnn8=8.9.3.28-1+cuda12.2

sudo apt-get install libcudnn8-dev=8.x.x.x-1+cudaX.Y
sudo apt-get install libcudnn8-dev=8.9.3.28-1+cuda12.2

sudo apt-get install libcudnn8-samples=8.x.x.x-1+cudaX.Y
sudo apt-get install libcudnn8-samples=8.9.3.28-1+cuda12.2

base) peter@p1:~/Downloads$ sudo cp /var/cudnn-local-repo-ubuntu2204-8.9.3.28/cudnn-local-BD12C98D-keyring.gpg /usr/share/keyrings/
(base) peter@p1:~/Downloads$ sudo dpkg -i cudnn-local-repo-ubuntu2204-8.9.3.28_1.0-1_amd64.deb
(Reading database … 228174 files and directories currently installed.)
Preparing to unpack cudnn-local-repo-ubuntu2204-8.9.3.28_1.0-1_amd64.deb …
Unpacking cudnn-local-repo-ubuntu2204-8.9.3.28 (1.0-1) over (1.0-1) …
Setting up cudnn-local-repo-ubuntu2204-8.9.3.28 (1.0-1) …

(base) peter@p1:~/Downloads$ sudo apt-get update
Get:1 file:/var/cuda-repo-ubuntu2204-12-2-local InRelease [1,572 B]

Reading package lists… Done
W: https://packages.microsoft.com/repos/vscode/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

sudo apt-get install libcudnn8=8.9.3.28-1+cuda12.2

(base) peter@p1:~/Downloads$ sudo apt-get install libcudnn8=8.9.3.28-1+cuda12.2
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Package libcudnn8 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Version ‘8.9.3.28-1+cuda12.2’ for ‘libcudnn8’ was not found

(base) peter@p1:~/Downloads$ sudo apt-get install libcudnn8-dev=8.9.3.28-1+cuda12.2
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Package libcudnn8-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Version ‘8.9.3.28-1+cuda12.2’ for ‘libcudnn8-dev’ was not found

(base) peter@p1:~/Downloads$ sudo apt-get install libcudnn8-samples=8.9.3.28-1+cuda12.2
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Package libcudnn8-samples is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Version ‘8.9.3.28-1+cuda12.2’ for ‘libcudnn8-samples’ was not found

It doesn’t seem like the instructions in the guide are correct.

Does the dpkg command use the .deb file to make Repos local ?

if so, is apt-get the appropriate command ?
it obviously is not able to find the repo’s correctly.

Please Advise

I’d like to understand better what happens when using the ‘dpkg’ command to create a local repo.

Somewhere in the process, It is failing
So I’ll need to confirm that I have the correct packages, and verify that, otherwise Get them and put them in the place where needed.

Also the apt-get commands seem to be using a slightly different syntax ( with an = sign in it ).
Could this be part of the problem ?
I would like to dive in, to find a solutions

Still need help on this, if Any Experts have a suggestions

Here was the last successful command:

sudo dpkg -i cudnn-local-repo-ubuntu2204-8.9.3.28_1.0-1_amd64.deb

These (3) commands all have errors - and I didn’t get any farther; Let’s see If I can progress on it. Thank You

sudo apt-get install libcudnn8=8.9.3.28-1+cuda12.2

sudo apt-get install libcudnn8-dev=8.9.3.28-1+cuda12.2

sudo apt-get install libcudnn8-samples=8.9.3.28-1+cuda12.2

I tried the new version - and it worked !

sudo dpkg -i cudnn-local-repo-ubuntu2204-8.9.4.25_1.0-1_amd64.deb

sudo apt-get install libcudnn8=8.9.4.25-1+cuda12.2

sudo apt-get install libcudnn8-dev=8.9.4.25-1+cuda12.2

sudo apt-get install libcudnn8-samples=8.9.4.25-1+cuda12.2

I want to check to verify cuDNN -
the sample verification project: mnistCUDNN
it seems like FreeImage is a pre-requisite
and building FreeImage on Ubuntu -
:: Having the following errors - problems - so Looking into the following ::
any Advice welcomed - as usual

In file included from Source/FreeImage/…/OpenEXR/IlmImf/ImfHeader.h:51,
from Source/FreeImage/…/OpenEXR/IlmImf/ImfOutputFile.h:46,

Source/OpenEXR/Imath/ImathVec.h:232:48: error: ISO C++17 does not allow dynamic exception specifications
232 | Vec2 normalizedExc () const throw (IEX_NAMESPACE::MathExc);
| ^~~~~

ISO C++17 does not allow dynamic exception specifications FreeImage

ISO C++17 does not allow dynamic exception specifications FreeImage Ubuntu 22.04