Ubuntu下,dpkg安装出错的修复
参考
我在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安装软件遇到包依赖问题的处理方法
造冰箱的大熊猫@cnblogs 2019/9/10 向灵魂工程师致敬! 在Ubuntu环境下通过dpkg命令安装deb包时,如果遇到包依赖问题,如 $sudo dpkg -i xxx.deb (Rea ...
- Ubuntu使用dpkg安装软件依赖问题解决 ubuntu-tweak ubuntu 16.04 LTS 系统清理
Ubuntu使用dpkg安装软件依赖问题解决 这里以在ubuntu 16.04安装Ubuntu Tweak为例进行说明,通常安装包依赖问题都可以用这种方法解决: sudo apt-get instal ...
- Ubuntu下软件安装方式、PATH配置、查找安装位置
Ubuntu 18.04, 安装方式 目前孤知道的Ubuntu下安装软件方式有3种(命令): 1.make 2.apt/apt-get 3.dpkg 方式1基于软件源码安装,需要经历配置(可选).编译 ...
- Ubuntu下nagios安装(来源官网)
Ubuntu下nagios安装(来源官网) https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/toc.html h ...
- Ubuntu下Zabbix安装及使用问题
1.configure: error: MySQL library not found MySQL library not found root@kallen:~# apt-get install l ...
- Ubuntu下手动安装vscode
Ubuntu下手动安装vscode1.下载vscodewget https://vscode.cdn.azure.cn/stable/553cfb2c2205db5f15f3ee8395bbd5cf0 ...
- [转]:Ubuntu 下Apache安装和配置
[转]:Ubuntu 下Apache安装和配置_服务器应用_Linux公社-Linux系统门户网站 https://www.linuxidc.com/Linux/2013-06/85827.htm ...
- Ubuntu下编译安装postgreSQL 10.5
Ubuntu下编译安装postgreSQL 10.5 ubuntu 16.04 LTS系统postgreSQL 10.5 安装包准备 1.从PostgreSQL官网下载PostgreSQL的安装包 安 ...
- 在Ubuntu下编译安装GreatSQL
在Ubuntu下编译安装GreatSQL 本次介绍如何利用Docker构建Ubuntu环境,并将GreatSQL源码编译成二进制文件. 1.准备工作 先创建本次Docker的workdir为 /dat ...
随机推荐
- [译]流言终结者 —— SQL Server 是Sybase的产品而不是微软的
http://www.cnblogs.com/xxxtech/archive/2011/12/30/2307859.html by Euan Garden 这些年来我听说过关于这个流言的许多版本,其中 ...
- TortoiseSVN 清空已保存的用户信息
http://blog.csdn.net/zb358983019/article/details/72898231.如果使用的是安装版的SVN,则打开系统开始菜单中Tortoise下的Settings ...
- C# MediaPlayer的详细用法
AxWindowsMediaPlayer的详细用法 作者:龙昊雪 AxWindowsMediaPlayer的详细用法收藏 function StorePage(){d=document;t=d.sel ...
- 非微信内如何调起wap版微信支付
微信支付一直没有出wap版,wap版想用微信支付,只有在微信内调用才可以.今天偶然发现,中国电信一个wap站点, 不在微信内也能调起微信支付,而且官方还提供了一个demo. WAP怎么调起客户端? 在 ...
- PLSQL_通过UTL_MAIL发送并发程式结果报表至用户邮箱(案例)
2014-06-01 Created By BaoXinjian
- win7上安装theano keras深度学习框架
近期在学习深度学习,需要在本机上安装keras框架,好上手.上网查了一些资料,弄了几天今天终于完全搞好了.本次是使用GPU进行加速,使用cpu处理的请查看之前的随笔keras在win7下环境搭建 本机 ...
- Clojure 下的 xpath 库
clj-xpath 项目网站 Github
- 重温java中的String,StringBuffer,StringBuilder类
不论什么一个系统在开发的过程中, 相信都不会缺少对字符串的处理. 在 java 语言中, 用来处理字符串的的类经常使用的有 3 个: String.StringBuffer.StringBuilder ...
- Memcached安装使用和源代码调试
memcached官网:http://memcached.org/ 一.安装 下载 # wget http://www.memcached.org/files/memcached-1.4.25.tar ...
- 简单实用的php分页函数代码
一个简单实用的php分页函数,分页导航中可以默认为空,在函数内部再设置本页URL. 代码: <?php /** * 分页 * @category 功能 * @param $totle:信息总数 ...