1

I tried installing kali-win-kex by following the official guide.

    $ sudo apt install kali-win-kex -y
    dpkg: error processing archive /var/cache/apt/archives/kali-win-kex_2.7_amd64.deb (--unpack):
     new kali-win-kex package pre-installation script subprocess returned error exit status 1
    Errors were encountered while processing:
     /var/cache/apt/archives/kali-win-kex_2.7_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

Trying apt install -f solve the problem changes package status from half-installed to uninstalled.

Trying to install the package directly leads to the following error:

$ sudo dpkg -i /var/cache/apt/archives/kali-win-kex_2.7_amd64.deb
(Reading database ... 102450 files and directories currently installed.)
Preparing to unpack .../kali-win-kex_2.7_amd64.deb ...
This package is for WSL 2. Nothing to be done here.
dpkg: error processing archive /var/cache/apt/archives/kali-win-kex_2.7_amd64.deb (--install):
 new kali-win-kex package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/kali-win-kex_2.7_amd64.deb

How can I install kali-win-kex?

Windows version: 19042.746
Kali version: 2020.4 (kali-rolling)

NOTE: This should probably be the same as this question: Cannot install Kali-WIn-Kex because of Dpkg error but reviewer decided this should be a new question.

1 Answer 1

0

The package kali-win-kex tests for WSL2 by checking if /mnt/wsl exists but it seems WSL is not creating that directory.

To install this package:

$ sudo mkdir -p /mnt/wsl
$ sudo apt install -y kali-win-kex
3
  • Creating /mnt/wsl in this way might fix the install problem, but is not a good long-term solution, as it will break the inter-instance file transfer mechanism. Better to figure out why WSL isn't creating it automatically in Kali. Do you happen to have a /etc/wsl.conf? Feb 10, 2021 at 22:06
  • @NotTheDr01ds the long term solution is to use a better test for WSL2, a solution proposal is already submitted upstream.
    – xihh
    Feb 10, 2021 at 23:52
  • I'm just saying that if your answer recommends that people create a directory that will interfere with WSL functionality, it should at least also include deleting the manually created "wrong version" of the directory after the kex installation is completed. Feb 11, 2021 at 19:11

You must log in to answer this question.

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