在 WSL2 上安装 `kali-win-kex` 失败

在 WSL2 上安装 `kali-win-kex` 失败

我尝试kali-win-kex按照以下方式安装官方指南

    $ 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)

尝试apt install -f解决问题会将包状态从 更改half-installeduninstalled

尝试直接安装该包会出现以下错误:

$ 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

我该如何安装kali-win-kex

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

笔记: 这应该是一样的这个问题:Cannot install Kali-WIn-Kex due to Dpkg error但审稿人认为这应该是一个新问题。

答案1

该包kali-win-kex通过检查是否存在来测试 WSL2 /mnt/wsl,但 WSL 似乎没有创建该目录。

要安装此软件包:

$ sudo mkdir -p /mnt/wsl
$ sudo apt install -y kali-win-kex

相关内容