我正在尝试在 mu ubuntu 12.04 上使用命令sudo apt-get upgrade
。但它显示了错误。这是我将 php 5.4 升级到 php5.5 之后的情况。
您可能需要运行“apt-get -f install”来更正这些问题。以下软件包具有未满足的依赖关系:libapache2-mod-php5:依赖:apache2-api-20120211 依赖:apache2 (>= 2.4) E:未满足的依赖关系。尝试使用 -f。
然后我运行命令
sudo apt-get install -f
修复依赖问题,但它也给了我错误
Unpacking apache2-bin (from
.../apache2-bin_2.4.16-3+deb.sury.org~precise+1_amd64.deb) ... dpkg:
error processing
/var/cache/apt/archives/apache2-bin_2.4.16-3+deb.sury.org~precise+1_amd64.deb
(--unpack): trying to overwrite '/usr/share/man/man8/apache2.8.gz',
which is also in package apache2.2-common 2.2.22-1ubuntu1.10 dpkg-deb
(subprocess): subprocess data was killed by signal (Broken pipe)
dpkg-deb: error: subprocess <decompress> returned error exit status 2
Unpacking apache2-data (from
.../apache2-data_2.4.16-3+deb.sury.org~precise+1_all.deb) ... dpkg:
error processing
/var/cache/apt/archives/apache2-data_2.4.16-3+deb.sury.org~precise+1_all.deb
(--unpack): trying to overwrite '/usr/share/apache2/icons/a.png',
which is also in package apache2.2-common 2.2.22-1ubuntu1.10 dpkg-deb
(subprocess): subprocess data was killed by signal (Broken pipe)
dpkg-deb: error: subprocess <decompress> returned error exit status 2
Preparing to replace apache2 2.2.22-1ubuntu1.10 (using
.../apache2_2.4.16-3+deb.sury.org~precise+1_amd64.deb) ... Unpacking
replacement apache2 ... dpkg: error processing
/var/cache/apt/archives/apache2_2.4.16-3+deb.sury.org~precise+1_amd64.deb
(--unpack): trying to overwrite
'/usr/share/apache2/ask-for-passphrase', which is also in package
apache2.2-common 2.2.22-1ubuntu1.10 dpkg-deb (subprocess): subprocess
data was killed by signal (Broken pipe) dpkg-deb: error: subprocess
<decompress> returned error exit status 2 Processing triggers for
man-db ... Errors were encountered while processing:
/var/cache/apt/archives/apache2-bin_2.4.16-3+deb.sury.org~precise+1_amd64.deb
/var/cache/apt/archives/apache2-data_2.4.16-3+deb.sury.org~precise+1_all.deb
/var/cache/apt/archives/apache2_2.4.16-3+deb.sury.org~precise+1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
我也遇到了同样的问题。运行以下命令即可解决问题:
sudo dpkg -i --force-overwrite /var/cache/apt/archives/apache2-bin_2.4.16-3+deb.sury.org~precise+1_amd64.deb
sudo dpkg -i --force-overwrite /var/cache/apt/archives/apache2-data_2.4.16-3+deb.sury.org~precise+1_all.deb
sudo dpkg -i --force-overwrite /var/cache/apt/archives/apache2_2.4.16-3+deb.sury.org~precise+1_amd64.deb
之后 sudo“apt-get -f install” 工作正常!
答案2
使用以下方式添加存储库
add-apt-repository ppa:ondrej/php5
apt-get update
删除所有以前的 php 版本。然后重新安装您喜欢的版本。然后为 cgi 和 fcgi 添加模块 php-cgi。
现在,您将能够使用 FCGI 和 cgi 脚本。mod_apache
这将是一个问题,但您将能够使用它。确保在安装 php-cgi 后重新启动 apache