dpkg: error processing package *** (--configure)错误解决办法

dpkg: error processing package *** (--configure)错误解决办法

https://blog.csdn.net/dou3516/article/details/105120221

 

在 Ubuntu 执行 sudo apt-get upgrade 或sudo apt-get install 时,出现了如下的报错:

dpkg: error processing package ***

subprocess installed post-installation script returned error exit status 127

这主要是由于不完全安装导致的。解决方式是删除或编辑安装信息文件。

粗暴方法一:删除所有信息之后update

sudo mv /var/lib/dpkg/info/ /var/lib/dpkg/info_old/
sudo mkdir /var/lib/dpkg/info/
sudo apt-get update

执行完以上代码后再用sudo apt-get install 安装

精细方法二:查看出错信息,定向删除或编辑

出错信息subprocess installed post-installation script returned error exit status 127中

可以看到这里的提示post-installation的问题,那么需要编辑该文件,具体在

/var/lib/dpkg/info/[package_name].postinst

同理,还有可能出问题的是"pre-removal" or "post-removal" 对应后缀 .prerm or .postrm

此时删除问题文件或编辑注释掉所有或问题内容即可。例如

sudo rm /var/lib/dpkg/info/[package_name].postinst
# 或更狠一点,全删
# sudo rm /var/lib/dpkg/info/[package_name].*
sudo dpkg --configure -a
sudo apt-get update

执行完以上代码后再用sudo apt-get install 安装

参考:

1.how-to-remove-install-a-package-that-is-not-fully-installed

2.dpkg: error processing package *** (--configure)解决办法

 

https://askubuntu.com/questions/804997/dpkg-error-processing-package-libc-bin-configure

dpkg: error processing package libc-bin (--configure)

After upgrading to Ubuntu 16.04, I cannot update my system. After the usual:

apt-get upgrade

I get this error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up libc-bin (2.23-0ubuntu3) ...
Segmentation fault (core dumped)
/sbin/ldconfig.real: Can't stat /lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Can't stat /usr/lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
Segmentation fault (core dumped)
dpkg: error processing package libc-bin (--configure):
 subprocess installed post-installation script returned error exit status 139
Errors were encountered while processing:
 libc-bin
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any ideas on how to fix this? apt-get clean and apt-get -f install did nothing.

 

If it is in WSL, try (tks lifesaver.codes)

sudo mv /var/lib/dpkg/info/libc-bin.* /tmp/

sudo dpkg --remove --force-remove-reinstreq libc-bin

sudo dpkg --purge libc-bin

sudo apt install libc-bin

sudo mv /tmp/libc-bin.* /var/lib/dpkg/info/

 

============ End

 

posted @   lsgxeva  阅读(315)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
历史上的今天:
2018-01-20 nslookup命令详解
2018-01-20 DNS使用的是TCP协议还是UDP协议
点击右上角即可分享
微信分享提示