E: 子进程 已安装的 post-removal 脚本 返回了错误号 2

http://forum.ubuntu.org.cn/viewtopic.php?f=77&t=213816
error  信息如下
正在设置 sl (3.03-16) ...
在处理时有错误发生:
 man-db
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@liu-laptop:/work_two# apt-get -f install
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列软件包是自动安装的并且现在不需要了:
  python-iniparse
使用'apt-get autoremove'来删除它们
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
有 1 个软件包没有被完全安装或卸载。
解压缩后会消耗掉 0B 的额外空间。
/usr/sbin/dpkg-preconfigure: 6: BEGIN: not found
eval: 1: qq{: not found
/usr/sbin/dpkg-preconfigure: 8: use: not found
/usr/sbin/dpkg-preconfigure: 9: use: not found
/usr/sbin/dpkg-preconfigure: 10: Syntax error: "(" unexpected
正在设置 man-db (2.5.7-2ubuntu1) ...
/usr/share/debconf/frontend: 5: use: not found
/usr/share/debconf/frontend: 6: use: not found
/usr/share/debconf/frontend: 7: use: not found
/usr/share/debconf/frontend: 8: Syntax error: "(" unexpected
dpkg:处理 man-db (--configure)时出错:
 子进程 已安装的 post-installation 脚本 返回了错误号 2
在处理时有错误发生:
 man-db
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@liu-laptop:/work_two# apt-get autoremove
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列软件包将被【卸载】:
  python-iniparse
升级了 0 个软件包,新安装了 0 个软件包,要卸载 1 个软件包,有 0 个软件包未被升级。
有 1 个软件包没有被完全安装或卸载。
解压缩后将会空出 127kB 的空间。
您希望继续执行吗?[Y/n]y
/usr/sbin/dpkg-preconfigure: 6: BEGIN: not found
eval: 1: qq{: not found
/usr/sbin/dpkg-preconfigure: 8: use: not found
/usr/sbin/dpkg-preconfigure: 9: use: not found
/usr/sbin/dpkg-preconfigure: 10: Syntax error: "(" unexpected
(正在读取数据库 ... 
dpkg:警告:无法找到软件包“wireless-tools”的文件名列表文件,现假定该软件包目前没有任何文件被安装在系统里。


dpkg:警告:无法找到软件包“wireless-crda”的文件名列表文件,现假定该软件包目前没有任何文件被安装在系统里。
(正在读取数据库 ... 系统当前总共安装有 290328 个文件和目录。)
正在删除 python-iniparse ...
正在处理用于 python-support 的触发器...
正在设置 man-db (2.5.7-2ubuntu1) ...
/usr/share/debconf/frontend: 5: use: not found
/usr/share/debconf/frontend: 6: use: not found
/usr/share/debconf/frontend: 7: use: not found
/usr/share/debconf/frontend: 8: Syntax error: "(" unexpected
dpkg:处理 man-db (--configure)时出错:
 子进程 已安装的 post-installation 脚本 返回了错误号 2
在处理时有错误发生:
 man-db
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@liu-laptop:/work_two# ls /usr/share/debconf/frontend 
/usr/share/debconf/frontend
root@liu-laptop:/work_two# ls /usr/share/debconf/frontend  -al
-rwxr-xr-x 1 root root 2278 2010-04-09 22:33 /usr/share/debconf/frontend
root@liu-laptop:/work_two# vi /var/lib/dpkg/status
root@liu-laptop:/work_two# vi /var/lib/dpkg/status
root@liu-laptop:/work_two# vi /var/lib/dpkg/status
root@liu-laptop:/work_two# apt-get -f install
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
正在更正依赖关系... 完成
将会安装下列额外的软件包:
  wireless-crda
下列【新】软件包将被安装:
  wireless-crda
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
有 1 个软件包没有被完全安装或卸载。
需要下载 16.0kB 的软件包。
解压缩后会消耗掉 119kB 的额外空间。
您希望继续执行吗?[Y/n]y
获取:1 http://cn.archive.ubuntu.com/ubuntu/ lucid/main wireless-crda 1.12 [16.0kB]
下载 16.0kB,耗时 1秒 (15.0kB/s) 
/usr/sbin/dpkg-preconfigure: 6: BEGIN: not found
eval: 1: qq{: not found
/usr/sbin/dpkg-preconfigure: 8: use: not found
/usr/sbin/dpkg-preconfigure: 9: use: not found
/usr/sbin/dpkg-preconfigure: 10: Syntax error: "(" unexpected
选中了曾被取消选择的软件包 wireless-crda。
(正在读取数据库 ... 
dpkg:警告:无法找到软件包“wireless-tools”的文件名列表文件,现假定该软件包目前没有任何文件被安装在系统里。
(正在读取数据库 ... 系统当前总共安装有 290317 个文件和目录。)
正在解压缩 wireless-crda (从 .../wireless-crda_1.12_amd64.deb) ...
正在设置 man-db (2.5.7-2ubuntu1) ...
/usr/share/debconf/frontend: 5: use: not found
/usr/share/debconf/frontend: 6: use: not found
/usr/share/debconf/frontend: 7: use: not found
/usr/share/debconf/frontend: 8: Syntax error: "(" unexpected
dpkg:处理 man-db (--configure)时出错:
 子进程 已安装的 post-installation 脚本 返回了错误号 2
正在设置 wireless-crda (1.12) ...
在处理时有错误发生:
 man-db
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@liu-laptop:/work_two# aptitude remove
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
正在初始化软件包状态... 完成
正在编辑扩展状态信息... 完成  
下列仅部分安装的软件包将被配置:
  man-db 
0 个软件包被升级,新安装 0 个, 0 个将被删除, 同时 0 个将不升级。
需要获取 0B 的存档。 解包后将要使用 0B。
正在编辑扩展状态信息... 完成
/usr/sbin/dpkg-preconfigure: 6: BEGIN: not found
eval: 1: qq{: not found
/usr/sbin/dpkg-preconfigure: 8: use: not found
/usr/sbin/dpkg-preconfigure: 9: use: not found
/usr/sbin/dpkg-preconfigure: 10: Syntax error: "(" unexpected
正在设置 man-db (2.5.7-2ubuntu1) ...
/usr/share/debconf/frontend: 5: use: not found
/usr/share/debconf/frontend: 6: use: not found
/usr/share/debconf/frontend: 7: use: not found
/usr/share/debconf/frontend: 8: Syntax error: "(" unexpected
dpkg:处理 man-db (--configure)时出错:
 子进程 已安装的 post-installation 脚本 返回了错误号 2
在处理时有错误发生:
 man-db
E: Sub-process /usr/bin/dpkg returned an error code (1)
软件包安装失败。正在试图恢复:
正在设置 man-db (2.5.7-2ubuntu1) ...
/usr/share/debconf/frontend: 5: use: not found
/usr/share/debconf/frontend: 6: use: not found
/usr/share/debconf/frontend: 7: use: not found
/usr/share/debconf/frontend: 8: Syntax error: "(" unexpected
dpkg:处理 man-db (--configure)时出错:
 子进程 已安装的 post-installation 脚本 返回了错误号 2
在处理时有错误发生:
 man-db
正在读取软件包列表... 完成     
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
正在读取扩展状态文件      
正在初始化软件包状态... 完成


root@liu-laptop:/work_two# aptitude update
读取:1 http://dl.google.com stable Release.gpg [198B]                          
忽略 http://dl.google.com/linux/chrome/deb/ stable/main Translation-zh_CN       
读取:2 http://dl.google.com stable Release [1,351B]                            
命中 http://archive.canonical.com lucid Release.gpg                             
忽略 http://archive.canonical.com/ lucid/partner Translation-zh_CN              
读取:3 http://dl.google.com stable/main Packages [1,258B]                      
读取:4 http://security.ubuntu.com lucid-security Release.gpg [198B]            
忽略 http://security.ubuntu.com/ubuntu/ lucid-security/main Translation-zh_CN
忽略 http://security.ubuntu.com/ubuntu/ lucid-security/restricted Translation-zh_CN
命中 http://archive.canonical.com lucid Release
忽略 http://security.ubuntu.com/ubuntu/ lucid-security/universe Translation-zh_CN
忽略 http://security.ubuntu.com/ubuntu/ lucid-security/multiverse Translation-zh_CN
读取:5 http://security.ubuntu.com lucid-security Release [57.3kB]
命中 http://cn.archive.ubuntu.com lucid Release.gpg                    
命中 http://archive.canonical.com lucid/partner Packages                
命中 http://cn.archive.ubuntu.com/ubuntu/ lucid/main Translation-zh_CN  
命中 http://cn.archive.ubuntu.com/ubuntu/ lucid/restricted Translation-zh_CN
命中 http://cn.archive.ubuntu.com/ubuntu/ lucid/universe Translation-zh_CN
命中 http://cn.archive.ubuntu.com/ubuntu/ lucid/multiverse Translation-zh_CN
命中 http://cn.archive.ubuntu.com lucid-updates Release.gpg
忽略 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/main Translation-zh_CN
忽略 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/restricted Translation-zh_CN
忽略 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/universe Translation-zh_CN
忽略 http://cn.archive.ubuntu.com/ubuntu/ lucid-updates/multiverse Translation-zh_CN
命中 http://cn.archive.ubuntu.com lucid Release     
命中 http://cn.archive.ubuntu.com lucid-updates Release                   
命中 http://cn.archive.ubuntu.com lucid/main Packages
命中 http://cn.archive.ubuntu.com lucid/restricted Packages
命中 http://cn.archive.ubuntu.com lucid/main Sources 
命中 http://cn.archive.ubuntu.com lucid/restricted Sources
命中 http://cn.archive.ubuntu.com lucid/universe Packages
命中 http://cn.archive.ubuntu.com lucid/universe Sources
命中 http://cn.archive.ubuntu.com lucid/multiverse Packages
命中 http://cn.archive.ubuntu.com lucid/multiverse Sources
命中 http://cn.archive.ubuntu.com lucid-updates/main Packages
命中 http://cn.archive.ubuntu.com lucid-updates/restricted Packages
命中 http://cn.archive.ubuntu.com lucid-updates/main Sources
命中 http://cn.archive.ubuntu.com lucid-updates/restricted Sources
命中 http://cn.archive.ubuntu.com lucid-updates/universe Packages
命中 http://cn.archive.ubuntu.com lucid-updates/universe Sources
命中 http://cn.archive.ubuntu.com lucid-updates/multiverse Packages
读取:6 http://security.ubuntu.com lucid-security/main Packages [417kB]
命中 http://cn.archive.ubuntu.com lucid-updates/multiverse Sources
读取:7 http://security.ubuntu.com lucid-security/restricted Packages [2,840B]  
读取:8 http://security.ubuntu.com lucid-security/main Sources [122kB]          
读取:9 http://security.ubuntu.com lucid-security/restricted Sources [1,259B]   
读取:10 http://security.ubuntu.com lucid-security/universe Packages [144kB]    
读取:11 http://security.ubuntu.com lucid-security/universe Sources [39.3kB]    
读取:12 http://security.ubuntu.com lucid-security/multiverse Packages [5,345B] 
读取:13 http://security.ubuntu.com lucid-security/multiverse Sources [2,323B]  
已下载 794kB,耗时 11秒 (69.7kB/s)                                              
正在读取软件包列表... 完成


root@liu-laptop:/work_two# apt-get install sl
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
sl 已经是最新的版本了。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
有 1 个软件包没有被完全安装或卸载。
解压缩后会消耗掉 0B 的额外空间。
/usr/sbin/dpkg-preconfigure: 6: BEGIN: not found
eval: 1: qq{: not found
/usr/sbin/dpkg-preconfigure: 8: use: not found
/usr/sbin/dpkg-preconfigure: 9: use: not found
/usr/sbin/dpkg-preconfigure: 10: Syntax error: "(" unexpected
正在设置 man-db (2.5.7-2ubuntu1) ...
/usr/share/debconf/frontend: 5: use: not found
/usr/share/debconf/frontend: 6: use: not found
/usr/share/debconf/frontend: 7: use: not found
/usr/share/debconf/frontend: 8: Syntax error: "(" unexpected
dpkg:处理 man-db (--configure)时出错:
 子进程 已安装的 post-installation 脚本 返回了错误号 2
在处理时有错误发生:
 man-db
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@liu-laptop:/work_two# dpkg-reconfigure 
/usr/sbin/dpkg-reconfigure: line 6: my:找不到命令
/usr/sbin/dpkg-reconfigure: line 8: use:找不到命令
/usr/sbin/dpkg-reconfigure: line 9: use:找不到命令
/usr/sbin/dpkg-reconfigure: line 10: use:找不到命令
/usr/sbin/dpkg-reconfigure: line 11: use:找不到命令
/usr/sbin/dpkg-reconfigure: line 12: use:找不到命令
/usr/sbin/dpkg-reconfigure: line 13: 在未预料的“(”附近出现语法错误
/usr/sbin/dpkg-reconfigure: line 13: `use Debconf::AutoSelect qw(:all);'
root@liu-laptop:/work_two# dpkg-reconfigure:/usr/bin/per
perl        perlbug     perlivp     perlthanks  
perl5.10.1  perldoc     perltex     perror      
root@liu-laptop:/work_two# dpkg-reconfigure:/usr/bin/per
perl        perlbug     perlivp     perlthanks  
perl5.10.1  perldoc     perltex     perror      
root@liu-laptop:/work_two# dpkg-reconfigure:/usr/bin/perl
perl        perlbug     perlivp     perlthanks  
perl5.10.1  perldoc     perltex     
root@liu-laptop:/work_two# dpkg-reconfigure:/usr/bin/perl
perl        perlbug     perlivp     perlthanks  
perl5.10.1  perldoc     perltex     
root@liu-laptop:/work_two# dpkg-reconfigure:/usr/bin/perl
perl        perlbug     perlivp     perlthanks  
perl5.10.1  perldoc     perltex     
root@liu-laptop:/work_two# dpkg-reconfigure:/usr/bin/perl
perl        perlbug     perlivp     perlthanks  
perl5.10.1  perldoc     perltex     
root@liu-laptop:/work_two# dpkg-reconfigure:/usr/bin/perl
bash: dpkg-reconfigure:/usr/bin/perl: 没有那个文件或目录
root@liu-laptop:/work_two# vi /usr/sbin/dpkg-reconfigure 
root@liu-laptop:/work_two# apt-get install perl
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
perl 已经是最新的版本了。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
有 1 个软件包没有被完全安装或卸载。
解压缩后会消耗掉 0B 的额外空间。


注意:你应该先去寻找其他解决方法,无效再来尝试本方法!!

本方法适用于任何软件包安装,删除时报告的类似于:“post-xxxxx失败”,以及其他错误。


---------言归正传---------

原理:dpkg之所以能够对每个包的状态了如指掌,完全是因为dpkg数据库--->>/var/lib/dpkg/status
这个文本文件中记录了软件仓库中曾经安装过的软件包的安装状态。
所以,只需要改动这个文件就能够改变软件包的状态。

软件包的状态:
引用:
1、not-installed
The package is not installed on your system.
2、config-files
Only the configuration files of the package exist on the system.
3、half-installed
The installation of the package has been started, but not com-
pleted for some reason.
4、unpacked
The package is unpacked, but not configured.
5、half-configured
The package is unpacked and configuration has been started, but
not yet completed for some reason.
6、 triggers-awaited
The package awaits trigger processing by another package.
7、 triggers-pending
The package has been triggered.
8、 installed
The package is unpacked and configured OK.

以上请详细参考man dpkg
根据以上状态:half-installed和half-configured是常见的错误状态,不完全配置,或者不完全安装。

还需要注意的是:
软件包还有一个选择状态:
引用:
1、install
The package is selected for installation.
2、deinstall
The package is selected for deinstallation (i.e. we want to
remove all files, except configuration files).
3、purge The package is selected to be purged (i.e. we want to remove
everything, even configuration files).


最后组合起来的错误状态大概就有6种,安装、删除出错都会将软件包的状态标记成其中之一!
它们的状态都要被修改成:install ok installed ; deinstall ok not-installed或purge ok not-installed。

最后需要注意的是:
软件包除了处在not-install 的状态,其余状态都是有完整的描述的。
要将错误状态修改成installed状态,需要查看一下软件包的描述是否有。(这个一般是有的)
要将错误状态修改成not-install状态,需要删除软件包的描述,删除Section行下面的全部。(不要把别人的删掉)

例子:
引用:
Package: libexempi3
Status: purge ok half-installed
Priority: optional
Section: libs
Installed-Size: 748
Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: i386
Source: exempi
Version: 2.0.2-2
Depends: libc6 (>= 2.4), libexpat1 (>= 1.95.8), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.2.1)
Description: library to parse XMP metadata (Library)
Exempi is a library to parse XMP metadata as defined by the
specification.
.
XMP (Extensible Metadata Platform) facilitates embedding metadata in files
using a subset of RDF. Most notably XMP supports embedding metadata in PDF
and many image formats, though it is designed to support nearly any file type.
Original-Maintainer: Asheesh Laroia <asheesh@asheesh.org>
Homepage:  http://libopenraw.freedesktop.org/wiki/Exempi

显然这个状态是有错误的。只要修改成:
引用:
Package: libexempi3
Status: purge ok not-installed
Priority: optional
Section: libs



终极解决:问题是我安装了一个错版本的perl的问题,导致脚本解析不正常。。。。。。。。。
下载新的 perl代码。。。编译新的代码。。。。。代替 老版本,在编译的时候要用普通用户的重要性。。。。。。。。
老的perl是arm的32位的可执行程序。。。。


_________________
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值