View Issue Details
|Kali Package Bug
|0007875: "sudo apt update" fails on fresh WSL2 install from CLI due to invalid signature GPG error
Host OS: Windows 10 Pro 21H2
After a successful WSL2 installation from CLI with the command "wsl --install -d kali-linux" and initial setup, running "sudo apt update" returns the following error:
Get:1 http://kali.download/kali kali-rolling InRelease [30.6 kB]
Attempting to open Kali Linux from the Microsoft Store (as documented in https://www.kali.org/docs/wsl/win-kex/) after unregistering kali-linux from WSL leads to the same outcome. Updating Kali Linux from the Microsoft Store afterwards also does not work.
Workaround: The update of Kali Linux from the Microsoft Store must be performed before running "wsl --unregister kali-linux" and reopening Kali Linux from the Microsoft Store.
|Steps To Reproduce
The manual download option for Kali Linux from Microsoft's WSL2 documentation (https://aka.ms/wsl-kali-linux-new) redirects to a file called "kali-linux-08-06-2019.appx". The stale date may be related to this issue.
The default WSL distribution, ubuntu, does not have this issue.
That sounds like it's pulling in the wrong release. Assuming it's pulling in a file dated 2019... can you check what /etc/os-release say? I'm gonna guess that it's 2019.3 or something.
You can manually update the key yourself, wget https://http.kali.org/kali/pool/main/k/kali-archive-keyring/<latestkeyringpackage>.deb and then install it with apt install ./kali-archive-keyring*.deb
But I'm kind of surprised that Microsoft is still caching 2019 and passing it along to users. Perhaps we can reach out to them.
Sorry for the delay in response - I failed to notice steev's previous comment somehow.
I just tried downloading https://aka.ms/wsl-kali-linux-new again, and this time I get a different package called KaliLinux_22.214.171.124.AppxBundle signed on August 24th 2022, which matches the current version from the Microsoft Store.
As such, the issue appears to have been resolved, although it may worth waiting the next release to ensure the linked bundle continues to get updated correctly as well.
Nevermind, I still get KaliLinux_126.96.36.199.AppxBundle from the link above even though the latest version on the Microsoft Store is 188.8.131.52.
With Microsoft phasing out the native version of WSL in favor of the Microsoft Store version, I'm not sure if this issue should be closed now or not:
|Note Added: 0016590
|new => assigned
|Note Added: 0016676
|Note Added: 0017243
|Note Added: 0017395