apt install 错误。恐慌:先前生成的反转列表的版本不正确

apt install 错误。恐慌:先前生成的反转列表的版本不正确

我设置了一个 rabbitmq-server,它在 ubuntu 16.04 上出现问题,因此我尝试重新安装它。

我遇到了这个:

$ sudo apt remove rabbitmq-server
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_xenial_main_binary-armhf_Packages

运行后sudo apt update(我需要sudo rm /var/lib/apt/lists/* -vf先从其他 stackoverflow 答案运行)我在删除 rabbitmq-server 时收到此错误

$ sudo apt remove rabbitmq-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  erlang-asn1 erlang-base erlang-corba erlang-crypto erlang-diameter erlang-edoc erlang-eldap erlang-erl-docgen erlang-eunit erlang-ic erlang-inets erlang-mnesia erlang-nox erlang-odbc erlang-os-mon erlang-parsetools erlang-percept
  erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssh erlang-ssl erlang-syntax-tools erlang-tools erlang-webtool erlang-xmerl libltdl7 libodbc1 libsctp1
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  rabbitmq-server
0 upgraded, 0 newly installed, 1 to remove and 178 not upgraded.
After this operation, 5,243 kB disk space will be freed.
Do you want to continue? [Y/n]

panic: Incorrect version for previously generated inversion list.

(Reading database ... 34410 files and directories currently installed.)
Removing rabbitmq-server (3.5.7-1ubuntu0.16.04.2) ...
panic: Incorrect version for previously generated inversion list.
dpkg: error processing package rabbitmq-server (--remove):
 subprocess installed post-removal script returned error exit status 255
Processing triggers for man-db (2.7.5-1) ...
panic: Incorrect version for previously generated inversion list.
Errors were encountered while processing:
 rabbitmq-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

在此之后,所有 apt 命令都出现问题,但我无法弄清楚panic: Incorrect version for previously generated inversion list.错误来自哪里。

答案1

事实证明,该问题是由一些 apt 安装前/安装后脚本使用的 perl 版本损坏/安装错误引起的,导致 apt 安装/删除失败

perl 脚本出现 panic: Incorrect version for previous generated inversion list. 错误来自

已修复sudo apt install perl

相关内容