Apt升级提示dpkgErrorProcessingPackageLibc-bin错误解决办法

apt工具进行安装或卸载时提示“dpkg: error processing package libc-bin (--configure)”错误。

1
2
3
4
5
dpkg: error processing package libc-bin (--configure):
installed libc-bin package post-installation script subprocess returned error exit status 134
Errors were encountered while processing:
libc-bin
E: Sub-process /usr/bin/dpkg returned an error code (1)

以下是解决办法

1.登录root账户

1
sudo su                                         # 切换到root用户

2.运行一下命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
mv /var/lib/dpkg/info/ /var/lib/dpkg/info_old/   # 备份保存的各个软件包的配置文件列表
mkdir /var/lib/dpkg/info/ # 新建保存的各个软件包的配置文件列表文件夹
apt update && apt install -f # 重新获取软件包列表
# Hit:1 http://mirrors.neusoft.edu.cn/kali kali-rolling InRelease
# Reading package lists... Done
# Building dependency tree... Done
# Reading state information... Done
# 20 packages can be upgraded. Run 'apt list --upgradable' to see them.
apt -f install # 尝试修正系统依赖损坏处
# 以下内容省略
# ......
# ......
# ......
mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old/ # 把更新的文件替换到备份文件夹
rm -rf /var/lib/dpkg/info # 把自己新建的info文件夹删掉
mv /var/lib/dpkg/info_old/ /var/lib/dpkg/info # 重新恢复还原保存的各个软件包的配置文件列表文件

3.验证是否成功

1
2
3
4
5
apt -f install                                    # 尝试修正系统依赖损坏处 
# Reading package lists... Done
# Building dependency tree... Done
# Reading state information... Done
# 0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.

4.重新升级

1
2
apt upgrade                                        # 重新获取软件包列表
apt upgrade -y # 更新软件包列表

5.参考资料

dpkg: error processing package xxx (—configure)的解决方法