在 Ubuntu 12.04 LTS 中无法获取最新的 PHP 或 Pear

在 Ubuntu 12.04 LTS 中无法获取最新的 PHP 或 Pear

我正在尝试安装 PEAR 和其他组件..但得到以下结果。

$ sudo apt-get install php5 libapache2-mod-php5 php5-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php5-mysql is already the newest version.
php5-mysql set to manually installed.
libapache2-mod-php5 is already the newest version.
libapache2-mod-php5 set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php5 : Depends: libapache2-mod-php5 (>= 5.5.11+dfsg-2+deb.sury.org~precise+1) but 5.5.10+dfsg-1+deb.sury.org~precise+1 is to be installed or
                 libapache2-mod-php5filter (>= 5.5.11+dfsg-2+deb.sury.org~precise+1) but it is not going to be installed or
                 php5-cgi (>= 5.5.11+dfsg-2+deb.sury.org~precise+1) but it is not going to be installed or
                 php5-fpm (>= 5.5.11+dfsg-2+deb.sury.org~precise+1) but 5.5.10+dfsg-1+deb.sury.org~precise+1 is to be installed
        Depends: php5-common (>= 5.5.11+dfsg-2+deb.sury.org~precise+1) but 5.5.10+dfsg-1+deb.sury.org~precise+1 is to be installed
E: Unable to correct problems, you have held broken packages.

我已按照此处的说明操作,以获取 PHP 5.5 的 PPA 设置...但我不清楚如何继续。

尝试在这些评论中建议的帖子后:

$ sudo apt-get clean
$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree       
Reading state information... Done
$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

答案1

确保sudo apt-get update在运行之前已经运行过sudo apt-get install php5 libapache2-mod-php5 php5-mysql,因为它将更新包列表,以便可以安装最新的软件。

相关内容