Ubuntu下,dpkg安装出错的修复
来源:互联网 发布:淘宝客通用计划是什么 编辑:程序博客网 时间:2024/04/29 13:53
参考
http://www.khattam.info/2009/08/04/solved-subprocess-pre-removal-script-returned-error-exit-status-2-error/
我在ubuntu上安装ldap-account-manager的时候出错,
当sudo aptitude install ldap-account-manager
出现如下错误:
- Reading package lists... Done
- Building dependency tree
- Reading state information... Done
- Reading extended state information
- Initializing package states... Done
- Building tag database... Done
- The following NEW packages will be automatically installed:
- php-fpdf php5 php5-ldap
- The following NEW packages will be installed:
- php-fpdf php5 php5-ldap
- 0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
- Need to get 108kB of archives. After unpacking 868kB will be used.
- Do you want to continue? [Y/n/?] y
- Writing extended state information... Error!
- E: I wasn't able to locate file for the ldap-account-manager package. This might mean you need to manually fix this package.
当我sudo dpkgdpkg -i ldap-account-manager2.4.all.deb
出现如下错误:
- Selecting previously deselected package ldap-account-manager.
- (Reading database ... 44030 files and directories currently installed.)
- Preparing to replace ldap-account-manager 2.4.0-1 (using ldap-account-manager2.4.all.deb) ...
- Unpacking replacement ldap-account-manager ...
- dpkg (subprocess): unable to execute old post-removal script: Exec format error
- dpkg: warning - old post-removal script returned error exit status 2
- dpkg - trying script from the new package instead ...
- dpkg: error processing ldap-account-manager2.4.all.deb (--install):
- subprocess new post-removal script returned error exit status 10
- dpkg: error while cleaning up:
- subprocess post-removal script returned error exit status 10
- Errors were encountered while processing:
- ldap-account-manager2.4.all.deb
这时候,
apt-get remove --purge,apt-get -f install
都不管用了
后来看了一人的解决方案,甚是感激啊。
其实就是将dpkg的status删除,我怎么就没有想到呢?
首先,确定以下命令不能用
- sudo aptitude update
- sudo aptitude -f install
然后,确定以下命令不能用
- sudo dpkg --force all --remove
如果都不行,恭喜你,你的dpkg真的有问题了。
现在开始
1、备份你的dpkg的status
sudo cp /var/lib/dpkg/status ~/backup/dpkg/
2、编辑status文件
sudo vim /var/lib/dpkg/status
3、查找你出问题的软件包,在本文中就是万恶的ldap-account-manager
在vim中
/ldap-account-manager
- 6474 Package: ldap-account-manager
- 6475 Status: deinstall reinstreq half-installed
- 6476 Priority: extra
- 6477 Section: web
- 6478 Installed-Size: 12268
- 6479 Maintainer: Roland Gruber <post@rolandgruber.de>
- 6480 Architecture: all
- 6481 Version: 2.4.0-1
- 6482 Depends: php5 (>= 5.1), php5-ldap, apache | apache-ssl | apache-perl | apache2 | httpd, php-fpdf, debconf (>= 0.2.26) | debconf-2.0
- 6483 Suggests: ldap-server, php5-mcrypt, ldap-account-manager-lamdaemon, perl
- 6484 Conffiles:
- 6485 /etc/ldap-account-manager/shells newconffile
- 6486 /etc/ldap-account-manager/config.cfg newconffile
- 6487 /etc/ldap-account-manager/passwordMailTemplate.txt newconffile
- 6488 /etc/ldap-account-manager/apache.conf newconffile
- 6489 Description: webfrontend for managing accounts in an LDAP directory
- 6490 LDAP Account Manager (LAM) runs on an existing webserver.It manages user, group
- 6491 and host accounts. Currently LAM supports these account types:
- 6492 Samba 2 and 3, Unix, Kolab 2, address book entries, NIS mail
- 6493 aliases and MAC addresses. There is a tree viewer included to
- 6494 allow access to the raw LDAP attributes. You can use templates
- 6495 for account creation and use multiple configuration profiles.
- 6496 Account information can be exported as PDF file. There is also
- 6497 a script included which manages quotas and homedirectories.
- 6498 Homepage: http://lam.sourceforge.net/
4、全删除整个关于ldap-account-manager的package,保存退出
5、保证格式
保证下一个package和上一个package中间有一行空行。
6、现在已经找不到ldap-account-manager包了,重新安装。当然aptitude已经可以正常使用了。
- Ubuntu下,dpkg安装出错的修复
- Ubuntu下,dpkg安装出错的修复
- Ubuntu下,dpkg安装出错的修复
- Ubuntu下,dpkg安装出错的修复
- Ubuntu下安装MySQL出错(dpkg: dependency problems prevent configuration of mysql-community-server)
- ubuntu下用dpkg安装文件
- ubuntu dpkg --configure 处理出错
- dpkg在ubuntu下的使用
- Ubuntu下的apt以及dpkg命令
- ubuntu PATH 出错修复
- ubuntu下安装insight出错
- Win7下自动修复wubi安装Ubuntu的引导
- dpkg损坏的修复方法
- ubuntu下安装程序的三种方法(apt,dpkg,make source)
- ubuntu下安装软件命令apt-get与dpkg命令的区别
- ubuntu下安装命令的区别(dpkg、apt-get、aptitude)
- ubuntu下安装软件命令apt-get与dpkg命令的区别
- 修复安装vs2010出错的处理方法
- 多线程趣味小题
- netfilter/iptables详细介绍
- 类型转换:int.Parse、int.TryParse
- bar.cnyes.com/html/100102-1/8D14899285B4C7E.shtml
- 怎样去选择制氧机
- Ubuntu下,dpkg安装出错的修复
- top命令的使用以及显示结果的介绍
- 命名的强制类型转换
- 健合制氧机——森林篇
- java中set,list,map的使用
- 工作记录 - spice客户端与服务器端MC(monitor config)协商机制修改
- 数据挖掘笔记-分类-决策树-SLIQ和SPRINT
- String常用的方法
- 氧气的作用_健合家用制氧机