Skip to content

Instantly share code, notes, and snippets.

@MooreDerek
Last active October 21, 2023 18:22
Show Gist options
  • Save MooreDerek/23686fc29a22d4e1e88e3dd9055fbb07 to your computer and use it in GitHub Desktop.
Save MooreDerek/23686fc29a22d4e1e88e3dd9055fbb07 to your computer and use it in GitHub Desktop.
Installing Kali on WSL getting apt update error

Installing Kali

wsl --install -d kali-linux

When terminal starts up try running

sudo apt upgrade and get the following error:

Get:1 http://wlglam.fsmg.org.nz/kali kali-rolling InRelease [30.6 kB]
Err:1 http://wlglam.fsmg.org.nz/kali kali-rolling InRelease
  The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>
Fetched 30.6 kB in 2s (13.7 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://wlglam.fsmg.org.nz/kali kali-rolling InRelease: The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>
W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease  The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>

Following the steps shown here: https://superuser.com/questions/1644520/apt-get-update-issue-in-kali

will resolve the issue, but you may see the following error:

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
--2021-10-26 10:24:41--  https://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2020.2_all.deb
Resolving http.kali.org (http.kali.org)... 192.99.200.113, 173.246.100.151, 217.70.187.11, ...
Connecting to http.kali.org (http.kali.org)|192.99.200.113|:443... connected.
ERROR: The certificate of ‘http.kali.org’ is not trusted.
ERROR: The certificate of ‘http.kali.org’ has expired.

This is easily fixed by pulling from http rather than https

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
@kylefmohr
Copy link

I summarized your initial post + the steps given by @niallriddell here, with credit given to you both. Thanks! I've needed this a couple of times now.

@nichollsc81
Copy link

@qx-775 December 2022, your resolution worked for me nicely.

@binarytrails
Copy link

binarytrails commented Jan 3, 2023

only bump is:

$ apt-get update
Get:1 http://kali.download/kali kali-rolling InRelease [30.6 kB]
Reading package lists... Done
E: Release file for http://http.kali.org/kali/dists/kali-rolling/InRelease is not valid yet (invalid for another 2h 56min 11s). Updates for this repository will not be applied.

anyone who doesn't have time to deal with windows nonsense can use this hack to move along:

apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update

@Yuvraj0157
Copy link

I am getting some other error while trying to install the package through dpkg.
sudo dpkg -i kali-archive-keyring_2022.1_all.deb
dpkg-deb: error: 'kali-archive-keyring_2022.1_all.deb' is not a Debian format archive
dpkg: error processing archive kali-archive-keyring_2022.1_all.deb (--install):
dpkg-deb --control subprocess returned error exit status 2
Errors were encountered while processing:
kali-archive-keyring_2022.1_all.deb

@kylefmohr
Copy link

I am getting some other error while trying to install the package through dpkg.
sudo dpkg -i kali-archive-keyring_2022.1_all.deb dpkg-deb: error: 'kali-archive-keyring_2022.1_all.deb' is not a Debian format archive dpkg: error processing archive kali-archive-keyring_2022.1_all.deb (--install): dpkg-deb --control subprocess returned error exit status 2 Errors were encountered while processing: kali-archive-keyring_2022.1_all.deb

Immediately before that command, you should have run wget http://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2022.1_all.deb, can you confirm that command executed successfully?

@ftdot
Copy link

ftdot commented Oct 21, 2023

Thank u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment