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_localto 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.pubWarning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).OK(base) peter72@Peter72:~$ sudo apt-get updateGet:1 file:/var/cuda-repo-wsl-ubuntu-11-5-local InReleaseIgn:1 file:/var/cuda-repo-wsl-ubuntu-11-5-local InReleaseGet:2 file:/var/cuda-repo-wsl-ubuntu-11-6-local InReleaseIgn:2 file:/var/cuda-repo-wsl-ubuntu-11-6-local InReleaseGet:3 file:/var/cuda-repo-wsl-ubuntu-11-5-local ReleaseErr: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 InReleaseHit:8 https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/amd64 InReleaseHit:9 http://archive.ubuntu.com/ubuntu jammy InReleaseHit:10 https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64 InReleaseHit:11 http://archive.ubuntu.com/ubuntu jammy-updates InReleaseHit:12 http://archive.ubuntu.com/ubuntu jammy-backports InReleaseReading package lists... DoneE: 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 cudaReading package lists... DoneBuilding dependency tree... DoneReading state information... DoneSome packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor 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 installableE: 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.