Kali Linux - 升级系统时出现 dpkg 错误。处理包 powershell-empire (--configure) 时出错:

Kali Linux - 升级系统时出现 dpkg 错误。处理包 powershell-empire (--configure) 时出错:

sudo apt update我在使用标准和更高版本的命令升级 Kali Linux VPSsudo apt upgrade时遇到了错误: Sub-process /usr/bin/dpkg returned an error code (1)

我是 Kali 的新手,所以我不知道为什么会发生这个错误?除了标准的 Kali 安装之外,我还安装了 XFCE 桌面环境和 POSTGRE SQL 数据库。没有其他的。但现在我使用 SSH 连接到服务器已经有一段时间了。

我更惊讶的是,因为我知道Kali使用APT包管理器,所以我不明白为什么那里会有DPKG错误。

(michal㉿kali)-[~]
└─$ sudo apt upgrade -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  baobab caribou cryptsetup-run folks-common gir1.2-caribou-1.0 gir1.2-clutter-1.0 gir1.2-cogl-1.0 gir1.2-coglpango-1.0 gir1.2-handy-0.0 gir1.2-mutter-8 gnom
  gnome-contacts gnome-core gnome-font-viewer gnome-logs gnome-online-miners gnome-tweak-tool golang-1.16-go golang-1.16-src gstreamer1.0-packagekit kwin-sty
  libamtk-5-0 libamtk-5-common libaom0 libavif12 libavif9 libcamel-1.2-62 libcaribou-common libcaribou0 libcbor0 libcodec2-0.9 libdap27 libdapclient6v5 libda
  libedataserver-1.2-25 libedataserverui-1.2-2 libepsilon1 libextutils-pkgconfig-perl libfluidsynth2 libfolks-eds26 libfolks26 libgdal28 libgdal29 libgdk-pix
  libgdk-pixbuf2.0-0 libgeos-3.9.0 libgeos-3.9.1 libgfbgraph-0.2-0 libgupnp-1.2-0 libhandy-0.0-0 libidn11 libkdecorations2private7 libkwineffects12a libkwing
  libkwinxrenderutils12 libmusicbrainz5-2 libmusicbrainz5cc2v5 libmutter-8-0 libnetcdf18 libntfs-3g883 libomp-11-dev libomp5-11 libplacebo72 libproj19 libquv
  libquvi-scripts-0.9 libstrictures-perl libtepl-5-0 libtracker-control-2.0-0 libtracker-miner-2.0-0 libtracker-sparql-2.0-0 liburcu6 liburing1 libvncclient1
  libwireshark14 libwiretap11 libwsutil12 libx265-192 libxmlb1 libyara4 libzapojit-0.0-0 linux-image-5.10.0-kali7-amd64 lua-bitop lua-expat lua-json lua-sock
  odbcinst1debian2 python3-editor python3-exif python3-gevent python3-gevent-websocket python3-ipython-genutils python3-jupyter-core python3-m2crypto python3
  python3-orjson python3-parameterized python3-pbr python3-plotly python3-pylnk python3-stem python3-tenacity python3-zope.event vlc-bin vlc-l10n vlc-plugin-
  vlc-plugin-notify vlc-plugin-qt vlc-plugin-samba vlc-plugin-skins2 vlc-plugin-video-splitter vlc-plugin-visualization
Use 'sudo apt autoremove' to remove them.
The following packages have been kept back:
  breeze breeze-cursor-theme kde-cli-tools kde-cli-tools-data kde-config-gtk-style kde-config-screenlocker kde-plasma-desktop kde-style-breeze khotkeys khotk
  kwin-common kwin-data kwin-style-breeze kwin-x11 libcolorcorrect5 libkdecorations2-5v5 libkdecorations2private9 libkf5sysguard-bin libkf5sysguard-data libk
  libkfontinstui5 libkscreenlocker5 libksgrd9 libksignalplotter9 libksysguardformatter1 libksysguardsensorfaces1 libksysguardsensors1 libkwaylandserver5
  libkwin4-effect-builtins1 libkwineffects13 libkwinglutils13 libkwinxrenderutils13 libkworkspace5-5 libnotificationmanager1 libplasma-geolocation-interface5
  libpowerdevilcore2 libpowerdevilui5 libprocesscore9 libprocessui9 libsemanage-common libtaskmanager6abi1 libweather-ion7 passwd plasma-desktop plasma-deskt
  plasma-workspace plasma-workspace-data powerdevil powerdevil-data qml-module-org-kde-ksysguard systemsettings
The following packages will be upgraded:
  libdecor-0-0 libdecor-0-plugin-1-cairo libnet-pcap-perl
3 upgraded, 0 newly installed, 0 to remove and 51 not upgraded.
4 not fully installed or removed.
Need to get 92.4 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://mirror.serverius.net/kali kali-rolling/main amd64 libdecor-0-plugin-1-cairo amd64 0.1.0-3 [19.0 kB]
Get:2 http://mirror.neostrada.nl/kali kali-rolling/main amd64 libdecor-0-0 amd64 0.1.0-3 [13.2 kB]
Get:3 http://mirror.neostrada.nl/kali kali-rolling/main amd64 libnet-pcap-perl amd64 0.20-1 [60.2 kB]
Fetched 92.4 kB in 1s (130 kB/s)
(Reading database ... 468468 files and directories currently installed.)
Preparing to unpack .../libdecor-0-plugin-1-cairo_0.1.0-3_amd64.deb ...
Unpacking libdecor-0-plugin-1-cairo:amd64 (0.1.0-3) over (0.1.0-2) ...
Preparing to unpack .../libdecor-0-0_0.1.0-3_amd64.deb ...
Unpacking libdecor-0-0:amd64 (0.1.0-3) over (0.1.0-2) ...
Preparing to unpack .../libnet-pcap-perl_0.20-1_amd64.deb ...
Unpacking libnet-pcap-perl (0.20-1) over (0.19-1) ...
Setting up powershell-empire (4.2.0-0kali2) ...
Traceback (most recent call last):
  File "/usr/share/powershell-empire/empire.py", line 11, in <module>
    import empire.server.server as server
  File "/usr/share/powershell-empire/empire/server/server.py", line 24, in <module>
    import socketio
  File "/usr/lib/python3/dist-packages/socketio/__init__.py", line 3, in <module>
    from .client import Client
  File "/usr/lib/python3/dist-packages/socketio/client.py", line 7, in <module>
    import engineio
  File "/usr/lib/python3/dist-packages/engineio/__init__.py", line 8, in <module>
    from .asyncio_client import AsyncClient
  File "/usr/lib/python3/dist-packages/engineio/asyncio_client.py", line 7, in <module>
    import aiohttp
  File "/usr/lib/python3/dist-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import (
  File "/usr/lib/python3/dist-packages/aiohttp/client.py", line 35, in <module>
    from . import hdrs, http, payload
  File "/usr/lib/python3/dist-packages/aiohttp/http.py", line 7, in <module>
    from .http_parser import (
  File "/usr/lib/python3/dist-packages/aiohttp/http_parser.py", line 15, in <module>
    from .helpers import NO_EXTENSIONS, BaseTimerContext
  File "/usr/lib/python3/dist-packages/aiohttp/helpers.py", line 667, in <module>
    class CeilTimeout(async_timeout.timeout):
TypeError: function() argument 'code' must be code, not str
dpkg: error processing package powershell-empire (--configure):
 installed powershell-empire package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of kali-linux-headless:
 kali-linux-headless depends on powershell-empire; however:
  Package powershell-empire is not configured yet.

dpkg: error processing package kali-linux-headless (--configure):
 dependency problems - leaving unconfigured
Setting up libdecor-0-0:amd64 (0.1.0-3) ...
Setting up libnet-pcap-perl (0.20-1) ...
dpkg: dependency problems prevent configuration of kali-linux-default:
 kali-linux-default depends on kali-linux-headless; however:
  Package kali-linux-headless is not configured yet.

dpkg: error processing package kali-linux-default (--configure):
 dependency problems - leaving unconfigured
Setting up libdecor-0-plugin-1-cairo:amd64 (0.1.0-3) ...
dpkg: dependency problems prevent configuration of kali-linux-large:
 kali-linux-large depends on kali-linux-default; however:
  Package kali-linux-default is not configured yet.

dpkg: error processing package kali-linux-large (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.32-4) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for kali-menu (2021.4.2) ...
Errors were encountered while processing:
 powershell-empire
 kali-linux-headless
 kali-linux-default
 kali-linux-large
E: Sub-process /usr/bin/dpkg returned an error code (1)

┌──(michal㉿kali)-[~]
└─$ ./setup/install.sh                                                                                                                                 100 ⨯
zsh: no such file or directory: ./setup/install.sh

(michal㉿kali)-[~]
└─$ sudo dpkg --configure -a                                                                                                                           130 ⨯
Setting up powershell-empire (4.2.0-0kali2) ...
Traceback (most recent call last):
  File "/usr/share/powershell-empire/empire.py", line 11, in <module>
    import empire.server.server as server
  File "/usr/share/powershell-empire/empire/server/server.py", line 24, in <module>
    import socketio
  File "/usr/lib/python3/dist-packages/socketio/__init__.py", line 3, in <module>
    from .client import Client
  File "/usr/lib/python3/dist-packages/socketio/client.py", line 7, in <module>
    import engineio
  File "/usr/lib/python3/dist-packages/engineio/__init__.py", line 8, in <module>
    from .asyncio_client import AsyncClient
  File "/usr/lib/python3/dist-packages/engineio/asyncio_client.py", line 7, in <module>
    import aiohttp
  File "/usr/lib/python3/dist-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import (
  File "/usr/lib/python3/dist-packages/aiohttp/client.py", line 35, in <module>
    from . import hdrs, http, payload
  File "/usr/lib/python3/dist-packages/aiohttp/http.py", line 7, in <module>
    from .http_parser import (
  File "/usr/lib/python3/dist-packages/aiohttp/http_parser.py", line 15, in <module>
    from .helpers import NO_EXTENSIONS, BaseTimerContext
  File "/usr/lib/python3/dist-packages/aiohttp/helpers.py", line 667, in <module>
    class CeilTimeout(async_timeout.timeout):
TypeError: function() argument 'code' must be code, not str
dpkg: error processing package powershell-empire (--configure):
 installed powershell-empire package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of kali-linux-headless:
 kali-linux-headless depends on powershell-empire; however:
  Package powershell-empire is not configured yet.

dpkg: error processing package kali-linux-headless (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of kali-linux-default:
 kali-linux-default depends on kali-linux-headless; however:
  Package kali-linux-headless is not configured yet.

dpkg: error processing package kali-linux-default (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of kali-linux-large:
 kali-linux-large depends on kali-linux-default; however:
  Package kali-linux-default is not configured yet.

dpkg: error processing package kali-linux-large (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 powershell-empire
 kali-linux-headless
 kali-linux-default
 kali-linux-large

我不知道这个问题该去哪里问。我在那里有一个数据库,这对我来说非常重要 - 这是我硕士学位的一部分,所以销毁服务器并重新安装 Kali 不是一个选择。

答案1

清除包

sudo apt purge powershell-empire

重新安装包

sudo apt install powershell-empire

...安装成功

答案2

删除/重新安装 powershell-empire 怎么样?今天早上它对我的情况有效,因为我和你有同样的问题。

免责声明:我不是一个 Linux 爱好者,所以 DYOR。在执行此操作之前请考虑进行备份,因为您说过如果发生任何情况则无法重新安装 Kali。

答案3

今天早上我遵循了你的指导。只有我做到了,不需要重新启动。

    $ powershell-empire -h
usage: empire.py [-h] {server,client} ...

positional arguments:
  {server,client}
    server         Launch Empire Server
    client         Launch Empire CLI

optional arguments:
  -h, --help       show this help message and exit
                                                                                                                                           
┌──(userName㉿gentoo)-[~]
└─$ which powershell-empire 
/usr/bin/powershell-empire 

正如我所说,一切正常,无需重新启动。

相关内容