I'm running Kali Linux in WSL2. It's a new installation (using wsl --install) but when I try to apt-get update I get the following error:
W: An error occurred during the signature verification. The repository is not updated and the previous
index files will be used. GPG error: kali-rolling InRelease: The
following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <>
W: Failed to fetch The following signatures
were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <>
W: Some index files failed to download. They have been ignored, or old ones used instead.Now I've seen other questions that suggest an apt-key command to fix this. However, this throws another error:
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operationI can't install gnupg because I haven't run apt update yet. What am I supposed to do here?
9 Answers
Yes, there appears to be issues with Kali Linux WSL (not downloaded from Microsoft Store).
The Kali archive keys appear to be missing and cannot be installed using apt-add key since it relies on GnuPG, which cannot be installed using apt, since the signatures cannot be verified.
The best solution is the one submitted by Jim which installed the Kali archive keys from a Debian package. Once this is done apt update and apt upgrade will work.
- Download the Debian package for the Kali archive keys
wget -O kali-archive-keyring_2020.2_all.deb - Install the Kali archive key package
sudo dpkg -i kali-archive-keyring_2020.2_all.deb - Update list of available packages from Kali repo
sudo apt update - Upgrade the WSL system
sudo apt full-upgrade
I did not alter /etc/apt/sources.list.
I solved the "An error occurred during the signature verification" with the following commands (run from root):
wget --no-check-certificate
dpkg -i kali-archive-keyring_2020.2_all.deb
apt update 2 if you encounter any 404 error messages when trying to download the keyring, please try the following:
Update 2022
for convenience reasons: the current keyring file changed, use the following commands:
# download
wget
# install
sudo dpkg -i kali-archive-keyring_2022.1_all.deb
# remove downloaded file again
rm kali-archive-keyring_2022.1_all.deb
# update
sudo apt-get update Manually download and install the needed package to verify the signature:
wget
sudo dpkg -i kali-archive-keyring_2020.2_all.debThen apt update and apt upgrade should work as expected.
Weird - the version of Kali downloaded by WSL with wsl --install is completely broken and is missing a lot of things. If you want to run Kali on WSL, download it from the Windows Store instead.
Adding a bit more to this as there is one extra step needed for me: Windows 11 WSL kali-linux
wget --no-check-certificate
dpkg -i kali-archive-keyring_2020.2_all.deb
apt update
apt install libcrypt1
apt full-upgrade
apt autoremoveWithout installing libcrypt1 first, an upgrade will lock you out of Kali.
Windows 11 (x64) #install wsl version 2 C:\> wsl --set-default-version 2 #install kali-linux distribution C:\> wsl --install --distribution kali-linux # get keyring # https will not work use http @:~$ wget -O kali-archive-keyring_2020.2_all.deb # use dpkg to install .deb user@hostname:~$ sudo dpkg -i kali-archive-keyring_2020.2_all.deb # apt update&upgrade user@hostname:~$ sudo apt update && sudo apt upgrade2
To add the Key first we need to download it from the website of the package you are installing. For example, here we are downloading the key file to add repositories for on Kali-rolling.
Install
wgetif you don’t already have it using:sudo apt install wgetAfter that use
wgetto download the key using:wget "link-to download-the-key"The command that worked for me was:
wget -q -O -The output from this should look like this:
-----BEGIN PGP PUBLIC KEY BLOCK-----mQINBE9U1CgBEAChen9+cvBS8ioHoCU6wBbL9jaIk5P7ZkPpjDsovMvimqZaozS8fEAZM23gJlFratc+rRllV9hPZmGqhtT50RLDzC3yFOvFnJqAPvpVDO2ipQCVnJDX0eWDhT62RDwk+FhjksEDwP7Yc4CgohdGDYQu1zTBSLL5qen3rckCnHF2OnSiKnYM8YCIKAYMt4VRArAvivjOMspN+1xy2S8GYXX2felsu3Ir1DXvUIE7b/9sdK6MzBcqjoDH34OqX6isqAW0+K93lmVN+U4yFMzfEB74UMQNWKg39mCB0K/VfQ89ih4zvF9azENbFzfF0O0h09oHF4ZTaUFeI8JImp/x9FC+LveUyJot9t/xv0HVUd08Y4PgO48CiXOTqqqm/DPF0AbHJGpTuonOsKy3/dYhk7Fvsfn02DMds+RKsukBEzypTIIIzMBFUwiq/GaaNRWw6lnOyE4wMmpwRa11QVDDWkMpuOr1tPV7M+EMAhZY7cyHDmRTOFL3H0CxYnInis+k1NQikqtLxNrzWdxsXU25BMbEsAQq7aRTs7wpOnUK+yY+qTG/V5nlJ6II+/CtWJthIef22r8EYX1BQOXRggamy0nxViC3S6kjuU2Lb1qnDb/c7T9hB7234T9yrRHJbygT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azyMul5dzA+1VxXqlTVZ5gH1/74PZP1YeKPgmSx3LrP3gpOP7Rp99wTZ77b9layR9ZyEPIdcIJF0QNSIrKXHjdh5pTqvLhnw58WjGFOhfyA0/YGsV2wbByGuSOAoGEZMg+hs44P3CudqoHQeHZOcflpRwRqheyZc+n2AGxN+RFpvaRV9cs8CiuHyvGHTgq7eear53ktZPxNR6/WtX7iCfqkg4=3Lxm-----END PGP PUBLIC KEY BLOCK-----After this you should now be able to use
aptto update without error:sudo apt-get updateThis is the quickest and easiest way that I have found to fix this issue as
apt-key addis deprecated. Everything else I have tried for several hours has returned the same error which is:The following signatures couldn't be verified because the public key is not available:NO_PUBKEY ED444FF07D8D0BF6Reading package lists... DoneW: GPG error: kali-rolling InRelease: The following signatures couldn't be verified because the public key is not available:NO_PUBKEY ED444FF07D8D0BF6E: The repository ' kali-rolling InRelease' is not signed.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.
Found this somewhere . Really helped me to update my OLD kali .For 2022
wget -O kali-archive-keyring_2022.1_all.deb
sudo dpkg -i kali-archive-keyring_2022.1_all.deb
1