I was following the chain of commands provided here:
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0&target_type=deb_local
to install cuda (v11.6) on wsl2. However, the last three lines failed. Here is what is in the terminal:
(base) peter72@Peter72:~$ sudo apt-key add /var/cuda-repo-wsl-ubuntu-11-6-local/7fa2af80.pub
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
(base) peter72@Peter72:~$ sudo apt-get update
Get:1 file:/var/cuda-repo-wsl-ubuntu-11-5-local InRelease
Ign:1 file:/var/cuda-repo-wsl-ubuntu-11-5-local InRelease
Get:2 file:/var/cuda-repo-wsl-ubuntu-11-6-local InRelease
Ign:2 file:/var/cuda-repo-wsl-ubuntu-11-6-local InRelease
Get:3 file:/var/cuda-repo-wsl-ubuntu-11-5-local Release
Err:3 file:/var/cuda-repo-wsl-ubuntu-11-5-local Release
File not found - /var/cuda-repo-wsl-ubuntu-11-5-local/Release (2: No such file or directory)
Get:4 file:/var/cuda-repo-wsl-ubuntu-11-6-local Release [564 B]
Get:4 file:/var/cuda-repo-wsl-ubuntu-11-6-local Release [564 B]
Get:6 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:7 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64 InRelease
Hit:8 https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/amd64 InRelease
Hit:9 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:10 https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64 InRelease
Hit:11 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:12 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
E: The repository 'file:/var/cuda-repo-wsl-ubuntu-11-5-local Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: file:/var/cuda-repo-wsl-ubuntu-11-6-local/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/amd64/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
(base) peter72@Peter72:~$ sudo apt-get -y install cuda
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libcufile-11-6 : Depends: liburcu6 but it is not installable
E: Unable to correct problems, you have held broken packages.
In the attempt to fix them, I downloaded another cuda version (v11.5) in hopes that it will work, but it didn't. I also removed the cuda repo folders manually, which led to chaos that I can't fix. I tried purging cuda and nvidia in the attempt to start fresh, but it didn't deliver.