bash sudo apt-get install php5-cli 时出错

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21354602/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 09:22:12  来源:igfitidea点击:

Error when sudo apt-get install php5-cli

linuxbashubuntu

提问by

I'm using linux mint. I'm trying to install php5-cli, but after execution a corresponding bash command I've the following log:

我正在使用 linux mint。我正在尝试安装 php5-cli,但在执行相应的 bash 命令后,我有以下日志:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
php5-cli is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 353 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
Setting up php5-common (5.4.6-1ubuntu1.5) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing php5-common (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up man-db (2.6.3-1) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing man-db (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of libapache2-mod-php5:
 libapache2-mod-php5 depends on php5-common (= 5.4.6-1ubuntu1.5); however:
  Package php5-common is not configured yet.

dpkg: error processing libapache2-mod-php5 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5-cli:
 php5-cli depends on php5-common (= 5.4.6-1ubuntu1.5); however:
  Package php5-common is not configured yet.

dpkg: error processing php5-cli (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 php5-common
 man-db
 libapache2-mod-php5
 php5-cli
E: Sub-

process /usr/bin/dpkg returned an error code (1)

进程 /usr/bin/dpkg 返回错误代码 (1)

If I'm trying to execute sudo apt-get install man-db or sudo apt-get install libapache2-mod-php5 I have the same errors. Why it occurred?

如果我试图执行 sudo apt-get install man-db 或 sudo apt-get install libapache2-mod-php5 我有同样的错误。为什么会发生?

回答by Artistan

I had this same error after symlinking the /etc/php5/cli/php.ini from /etc/php5/apache/php.ini I deleted the symlink and then called

从 /etc/php5/apache/php.ini 符号链接 /etc/php5/cli/php.ini 后,我遇到了同样的错误我删除了符号链接,然后调用

sudo apt-get -f install

all is good!

一切都很好!

回答by rmil

before above you should do

在上面你应该做的

sudo mv /etc/php5/cli/php.ini /etc/php5/cli/php.bak