There is no need to do the apt-key etc... the toolkit is already in the packages in newer versions of ubuntu.
Install the cuda driver: https://developer.nvidia.com/cuda/wsl
Install an ubuntu image using wsld, (wsld -i ubuntu -d cuda -o D:\.wsl2)
apt update && apt install nvidia-cuda-toolkit
Done.
For installing cudnn maybe is better to go to the installation guide: https://docs.nvidia.com/deeplearning/cudnn/install-guide/ind...