无法将 Kali 升级到 Debian

无法将 Kali 升级到 Debian

尝试将 kali 升级到 debian,但将 dash 0.5.8-2.5 升级到 0.5.8-2.6 时出错。结果sh没有找到。恢复系统通过:

rm /bin/sh        
ln -s /usr/bin/dash /bin/sh

因为当我尝试重新安装 dash 时 /bin/sh 得到错误的符号链接尝试重新安装 dash 并得到相同的错误:

apt install dash --reinstall
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 273 not upgraded.
1 not fully installed or removed.
Need to get 0 B/113 kB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 426445 files and directories currently installed.)
Preparing to unpack .../dash_0.5.8-2.6_amd64.deb ...
Unpacking dash (0.5.8-2.6) over (0.5.8-2.6) ...
Setting up dash (0.5.8-2.6) ...
Removing 'diversion of /bin/sh to /bin/sh.distrib by bash'
Adding 'diversion of /bin/sh to /bin/sh.distrib by dash'
Removing 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by bash'
Adding 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash'
dpkg: error: error executing hook 'if { test "$DPKG_HOOK_ACTION" = add-architecture || test "$DPKG_HOOK_ACTION" = remove-architecture; } && test -x /usr/share/pkg-config-dpkghook; then /usr/share/pkg-config-dpkghook update; fi', exit code 32512
E: Sub-process /usr/bin/dpkg returned an error code (2)
E: Problem executing scripts DPkg::Post-Invoke '/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit --object-path /org/freedesktop/PackageKit --timeout 4 --method org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo > /dev/null'
E: Sub-process returned an error code

lsb_release -a

No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.0 (stretch)
Release:    9.0
Codename:   stretch

答案1

不支持从 Kali 到 Debian 的升级路径。如果您想使用 Debian 而不是 Kali,则需要使用 Debian 安装程序来安装 Debian(下载安装程序图像),在你的 Kali 设置上。您必须事先备份您想要保留的所有数据。

在这种特殊情况下,你会遇到中的一个错误dash;这也表明您正在尝试安装 Debian不稳定版,如果您不这样做,则不建议您安装非常熟悉系统。您应该安装 Debian stable。

相关内容