apt-get 错误 phpldapadmin

apt-get 错误 phpldapadmin

想要使用本手册更新 ubuntu 12.04 上的 apache: https://www.ivankrizsan.se/2014/07/17/upgrading-apache-http-server-2-2-to-2-4-on-ubuntu-12-04/

我卸载了 apache2.2,现在我想安装 apache 2.4,但是当我想安装它时我收到了消息:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:

php5-cli : Depends: php5-common (= 5.3.10-1ubuntu3.6) but 5.3.10-1ubuntu3.26 is to be installed

php5-curl : Depends: php5-common (= 5.3.10-1ubuntu3.6) but 5.3.10-1ubuntu3.26 is to be installed

php5-gd : Depends: php5-common (= 5.3.10-1ubuntu3.6) but 5.3.10-1ubuntu3.26 is to be installed

php5-sqlite : Depends: php5-common (= 5.3.10-1ubuntu3.6) but 5.3.10-1ubuntu3.26 is to be installed

php5-tidy : Depends: php5-common (= 5.3.10-1ubuntu3.6) but 5.3.10-1ubuntu3.26 is to be installed

php5-xmlrpc : Depends: php5-common (= 5.3.10-1ubuntu3.6) but 5.3.10-1ubuntu3.26 is to be installed

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

使用“apt-get -f install”我得到:

invoke-rc.d: initscript apache2, action "restart" failed.
dpkg: error processing phpldapadmin (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 phpldapadmin
 E: Sub-process /usr/bin/dpkg returned an error code (1)

我不需要 phpldapadmin。我该怎么办?

答案1

看起来您仍安装了一些 PHP 软件包,版本为5.3.10-1ubuntu3.6,而新软件包正在尝试安装5.3.10-1ubuntu3.26。这些版本不匹配。请先尝试卸载旧的 PHP 软件包:

apt-get remove php5-cli php5-curl php5-gd php5-sqlite php5-tidy php5-xmlrpc php5-common phpldapadmin

可能还有其他 PHP 包,因此您可能还想使用通配符:

apt-get remove php5-* phpldapadmin

删除软件包之后,重新安装新版本的所有内容:

apt-get update
apt-get install php5-cli php5-curl php5-gd php5-sqlite php5-tidy php5-xmlrpc php5-common apache2

相关内容