安装 LSPHP 时出现软件包损坏和依赖项未满足的情况

安装 LSPHP 时出现软件包损坏和依赖项未满足的情况

我试图为 Openlitespeed 服务器安装 LSPHP 7.0。我的系统上已经安装了 PHP,这可能是导致混乱的原因。该安装未完成,现在我无法运行任何 apt-get 命令。我在尝试使用 apt-get 时总是遇到此错误

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:
 lsphp70 : Depends: lsphp70-common (>= 7.0.10-1+xenial) but it is not installed
 lsphp70-curl : Depends: lsphp70-common but it is not installed
 lsphp70-dev : Depends: lsphp70-common (>= 7.0.10-1+xenial) but it is not installed
 lsphp70-imap : Depends: lsphp70-common but it is not installed
 lsphp70-intl : Depends: lsphp70-common but it is not installed
 lsphp70-json : Depends: lsphp70-common but it is not installed
 lsphp70-ldap : Depends: lsphp70-common but it is not installed
 lsphp70-mysql : Depends: lsphp70-common but it is not installed
 lsphp70-opcache : Depends: lsphp70-common but it is not installed
 lsphp70-pgsql : Depends: lsphp70-common but it is not installed
 lsphp70-pspell : Depends: lsphp70-common but it is not installed
 lsphp70-recode : Depends: lsphp70-common but it is not installed
 lsphp70-snmp : Depends: lsphp70-common but it is not installed
 lsphp70-sqlite3 : Depends: lsphp70-common but it is not installed
 lsphp70-sybase : Depends: lsphp70-common but it is not installed
 lsphp70-tidy : Depends: lsphp70-common but it is not installed
E: Unmet dependencies. Try using -f.

以下是 apt-get -f install 的输出

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic
  linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic
  linux-signed-image-4.4.0-31-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  lsphp70-common
Suggested packages:
  php-user-cache
The following NEW packages will be installed:
  lsphp70-common
0 upgraded, 1 newly installed, 0 to remove and 92 not upgraded.
31 not fully installed or removed.
Need to get 0 B/29.7 kB of archives.
After this operation, 266 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 299142 files and directories currently installed.)
Preparing to unpack .../lsphp70-common_7.0.10-1+xenial_all.deb ...
Unpacking lsphp70-common (7.0.10-1+xenial) ...
dpkg: error processing archive /var/cache/apt/archives/lsphp70-common_7.0.10-1+xenial_all.deb (--unpack):
 trying to overwrite '/usr/sbin/phpquery', which is also in package php-common 1:35ubuntu6
Errors were encountered while processing:
 /var/cache/apt/archives/lsphp70-common_7.0.10-1+xenial_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

请建议如何修复该问题。我现在想摆脱 lsphp70 包。

答案1

此错误是由系统上的 php 包触发的。请确保通过以下方式将其全部删除:

apt-get remove php\*
apt autoremove

并重新安装 lsphp

相关内容