如何在以下 PHP cli 和 git 安装中更正 PHP 7.0.* 的命令?

如何在以下 PHP cli 和 git 安装中更正 PHP 7.0.* 的命令?

我在用着Ubuntu Linux 14.04 LTS 64 位我的机器上的操作系统。

我刚刚通过从终端运行以下命令更新了系统上安装的所有软件和软件包:

sudo apt-get update

sudo apt-get upgrade

现在我正在使用PHP 7.0.5,PHP 的最新当前稳定版本。

为了检查它,我从终端运行以下命令:

php -v

PHP 7.0.5-3+donate.sury.org~trusty+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

现在我尝试安装 Composer(项目依赖管理软件)。作为先决条件,它需要需要安装 cli 和 Git因此我输入了以下命令并收到以下错误。如何解决此错误?

sudo apt-get install curl php5-cli git

Reading package lists... Done
Building dependency tree       
Reading state information... Done
curl is already the newest version.
curl set to manually installed.
git is already the newest version.
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-cli : Depends: php5-common (= 5.5.9+dfsg-1ubuntu4.14) but 5.5.32+dfsg-1+deb.sury.org~precise+1 is to be installed
            Recommends: php5-readline but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我想要解决的错误如下,来自上面的输出:

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-cli : Depends: php5-common (= 5.5.9+dfsg-1ubuntu4.14) but 5.5.32+dfsg-1+deb.sury.org~precise+1 is to be installed
            Recommends: php5-readline but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

请有人为我提供我需要从终端运行的正确命令并消除此错误。

我认为这是因为我不再使用PHP 5.5.9。只需向我提供必要的命令。

提前致谢。

答案1

PHP 7.0 软件包已重命名,因此您要么寻找apt-get install php-cli安装将拉取默认 PHP 版本的依赖包,要么只是apt-get install php7.0-cli。我推荐前者。

相关内容