17

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: http://mirrors.jevincanders.net/kali kali-rolling InRelease: The 
following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <[email protected]>
W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease  The following signatures 
were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <[email protected]>
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 operation

I can't install gnupg because I haven't run apt update yet. What am I supposed to do here?

3
  • Which apt-key command did you run? GnuPG should already be installed by default (and indeed the initial output about signatures shows GPG is installed). Apr 26, 2021 at 6:13
  • @fuzzydrawings this is the specific one I used: wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add Apr 26, 2021 at 12:25
  • if you can't use apt may try downloading a compatible version of gnupg from debian package archive and then install the downloaded package with dpkg
    – Ruby
    Apr 27, 2021 at 14:11

11 Answers 11

19

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 https://http.kali.org/kali/pool/main/k/kali-archive-keyring/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
2
  • 1
    thank you it works now Sep 17, 2021 at 7:48
  • 4
    thanks it work actually make sure --no-check-certificate so you won't get expiry issue Nov 24, 2021 at 14:39
25

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 http://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2022.1_all.deb
# 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
3
  • Excellent. Thanks! Dec 6, 2022 at 15:43
  • So if the download path is compromised, the downloaded package over HTTP (an insecure channel) can be anything. Normally (and specifically requiring a correct archive keyring in the first place) the apt-get command validates the package's checksum against the signed release file. Here nothing such was done. It's about Kali, so "insecure channel" is not something hypothetical.
    – A.B
    Feb 18, 2023 at 23:02
  • The correct way is to have an other correctly installed system and use the results of the dry-run command apt-get --print-uris reinstall kali-archive-keyring (doesn't require root) run on that other system: URL + checksum verified against the signed release file.
    – A.B
    Feb 18, 2023 at 23:03
6

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 https://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2020.2_all.deb

dpkg -i kali-archive-keyring_2020.2_all.deb

apt update
2
  • This answer is the one that worked for me. The important difference is that I needed to include --no-check-certificate in the wget command. Oct 10, 2021 at 18:56
  • this method worked, but I had to download the file using firefox vs wget (with that line) Nov 6, 2021 at 15:49
2

Manually download and install the needed package to verify the signature:

wget https://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2020.2_all.deb
sudo dpkg -i kali-archive-keyring_2020.2_all.deb

Then apt update and apt upgrade should work as expected.

3
  • Please elaborate a little on what your answer is doing so that everyone can learn a little from it :)
    – fpnick
    May 24, 2021 at 18:50
  • @fpnick - It downloads and installs the Debian package.
    – Ramhound
    Jun 25, 2021 at 4:16
  • it worked for me, I just updated the naming from current version here http.kali.org/kali/pool/main/k/kali-archive-keyring
    – jirimertin
    Aug 20, 2022 at 17:40
2

Adding a bit more to this as there is one extra step needed for me: Windows 11 WSL kali-linux

wget --no-check-certificate https://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2020.2_all.deb

dpkg -i kali-archive-keyring_2020.2_all.deb

apt update
apt install libcrypt1
apt full-upgrade
apt autoremove

Without installing libcrypt1 first, an upgrade will lock you out of Kali.

2
  • 1
    for me just installing libcrypt locked me out of kali lol.. and nothing fixes it except reinstalling wsl kali...
    – Lorenzo
    Jul 5, 2022 at 9:09
  • 1
    you need to sudo upgrade perl-base first (which will pull in libcrypt) to avoid getting locked out
    – zencraft
    Sep 23, 2022 at 2:03
0

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.

2
  • What to do when your organization blocked Microsoft Store? Microsoft itself recommends to install the distribution then manually.
    – winklerrr
    Jun 24, 2021 at 11:35
  • The store and the --install version are the same, you can verify by manually installing first and going to the Windows Store page, it will say Open, not Get.
    – zencraft
    Sep 23, 2022 at 2:00
0
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 http://http.kali.org/kali/pool/main/k/kali-archive-keyring/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 upgrade

terminal screenshot

2
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Feb 2, 2022 at 5:56
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Feb 2, 2022 at 6:44
0

Found this somewhere . Really helped me to update my OLD kali .For 2022

wget -O kali-archive-keyring_2022.1_all.deb http://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2022.1_all.deb

sudo dpkg -i kali-archive-keyring_2022.1_all.deb

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Jun 10, 2022 at 14:32
0

Here is the fix just run this

wget -q -O - https://archive.kali.org/archive-key.asc | sudo gpg --dearmor -o /usr/share/keyrings/kali-archive-keyring.gpg

0

Update 2024

for convenience reasons: the current keyring file changed, use the following commands:

# download
wget http://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2024.1_all.deb
# install
sudo dpkg -i kali-archive-keyring_2024.1_all.deb
# remove downloaded file again
rm kali-archive-keyring_2024.1_all.deb
# update
sudo apt-get update

Updated the answer from kantholy to 2024

-1

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 wget if you don’t already have it using:

    sudo apt install wget

  • After that use wget to download the key using:

    wget "link-to download-the-key"

  • The command that worked for me was:

    wget -q -O - https://archive.kali.org/archive-key.asc

  • The output from this should look like this:

    -----BEGIN PGP PUBLIC KEY BLOCK-----

    mQINBE9U1CgBEAChen9+cvBS8ioHoCU6wBbL9jaIk5P7ZkPpjDsovMvimqZaozS8 fEAZM23gJlFratc+rRllV9hPZmGqhtT50RLDzC3yFOvFnJqAPvpVDO2ipQCVnJDX 0eWDhT62RDwk+FhjksEDwP7Yc4CgohdGDYQu1zTBSLL5qen3rckCnHF2OnSiKnYM 8YCIKAYMt4VRArAvivjOMspN+1xy2S8GYXX2felsu3Ir1DXvUIE7b/9sdK6MzBcq joDH34OqX6isqAW0+K93lmVN+U4yFMzfEB74UMQNWKg39mCB0K/VfQ89ih4zvF9a zENbFzfF0O0h09oHF4ZTaUFeI8JImp/x9FC+LveUyJot9t/xv0HVUd08Y4PgO48C iXOTqqqm/DPF0AbHJGpTuonOsKy3/dYhk7Fvsfn02DMds+RKsukBEzypTIIIzMBF Uwiq/GaaNRWw6lnOyE4wMmpwRa11QVDDWkMpuOr1tPV7M+EM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ELUz1YyjI4bSWYQ/gr5UQhOcNmH1KVULm/s6Sx 1MBUvWLXFxqb+T7PqWeUAIMTZTjfBiMqJjPzZ61zBBeQDKvciEy/UnunvX+e1cNQ 1aDzeqaQ3OqJaoFbjmzE218SelQvWCCWQ24ixgQZp8/xd3ae5oQNwqdC0Z6azyMu l5dzA+1VxXqlTVZ5gH1/74PZP1YeKPgmSx3LrP3gpOP7Rp99wTZ77b9layR9ZyEP IdcIJF0QNSIrKXHjdh5pTqvLhnw58WjGFOhfyA0/YGsV2wbByGuSOAoGEZMg+hs4 4P3CudqoHQeHZOcflpRwRqheyZc+n2AGxN+RFpvaRV9cs8CiuHyvGHTgq7eear53
    ktZPxNR6/WtX7iCfqkg4
    =3Lxm

    -----END PGP PUBLIC KEY BLOCK-----

  • After this you should now be able to use apt to update without error:

    sudo apt-get update

  • This is the quickest and easiest way that I have found to fix this issue as apt-key add is 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 ED444FF07D8D0BF6

    Reading package lists... Done

    W: GPG error: https://kali.download/kali kali-rolling InRelease: The following signatures couldn't be verified because the public key is not available:

    NO_PUBKEY ED444FF07D8D0BF6

    E: The repository 'https://http.kali.org/kali 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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .