Skip to content

Instantly share code, notes, and snippets.

@kylefmohr
Last active October 12, 2022 22:02
Show Gist options
  • Save kylefmohr/4cd11321a55669ce09c64b0967219a94 to your computer and use it in GitHub Desktop.
Save kylefmohr/4cd11321a55669ce09c64b0967219a94 to your computer and use it in GitHub Desktop.
This script will work around the issues present in Kali's Windows Subsystem for Linux version, which currently errors when you try to `apt update`, and if you get around that, errors during an `apt upgrade`. This was last tested as working on 10/12/2022

In Powershell, before you've installed Kali:

wsl --set-default-version 2
wsl --install -d kali-linux

Now create your Kali username and password. Then...

sudo su

(enter the password you just created)

wget http://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2022.1_all.deb
dpkg -i kali-archive-keyring_2022.1_all.deb
apt update
apt full-upgrade -y

It will error out, this is expected.

cd /tmp/
apt download libcrypt1 -y
dpkg-deb -x libcrypt1_1%3a4.4.28-2_amd64.deb .
cp -av lib/x86_64-linux-gnu/* /lib/x86_64-linux-gnu/
apt -f -y install
apt full-upgrade -y

If the wget command fails the Kali keyring probably got updated. Locate the newest version here. It'll be the file that ends with "_all.deb".

If the dpkg-deb command fails libcrypt1 probably got updated. Either use ls /tmp/ to locate the new filename, or start typing dpkg-deb -x libcrypt1 and hit tab (but don't forget the space + period at the end of the command)

Credit goes to @MooreDerek and @niallriddell for their posts/responses here

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