红联Linux门户
Linux帮助

dpkg Errors were encountered while processing错误的解决办法

发布时间:2017-07-08 16:04:56来源:linux网站作者:hejinjing_tom_com
今天用apt-get 删除一个包时遇到了错误, dpkg 也删除不了.
$ sudo apt-get purge wireshark-common
提示错误:  
忘了什么了, 大意是说wireshark 应该是什么,它不是什么,
blablabla ... 总之是它处理不了了, 大概是我动过什么了.
Errors were encountered while processing ....
subprocess post-removal script returned error exit status...
$dpkg -P wireshark-common
提示错误: 同上
dpkg -l 显示的是'pc' 状态.
工具不行了,只能手工进行了. 网上也搜了几下, 还是我的简单靠谱!
 
解决办法:
$sudo updatedb
$locate wireshark
找到的项全部删除(一看就知道无用),
对于/var/lib/info/ 下有两项,不用客气,删...!, 量它也起不了什么尘土!
再一次: $dpkg -P wireshark-common 成功!
$dpkg -l |grep wireshark  世界恢复正常!
 
补充知识:
查询依赖关系:
apt-cache depends proj
查询反向依赖关系:
apt-cache rdepends proj
What do the various dpkg flags like 'ii' 'rc' mean?
The first letter displays what is the expected status of the package.
The second letter displays what is the current status of the package.
So for example:
ii means 'It should be installed and it is installed' whereas
rc means 'It's removed/uninstalled but it's configuration files are still there'
删除查到的无用的配置信息(包已经删除,但配置信息还保留着).
dpkg -l | grep ^rc | cut -d' ' -f3 | sudo xargs dpkg --purge
或者
$ dpkg -l |grep ^rc |awk '{print $2}'|sudo xargs dpkg --purge
这样 rc 状态的包就没有了.
 
本文永久更新地址:http://www.linuxdiyf.com/linux/31884.html