【问题标题】:Unable to install PHP zip archive with PHP 7.2无法使用 PHP 7.2 安装 PHP zip 存档
【发布时间】:2018-06-13 13:50:39
【问题描述】:

我在安装 PHP zip 存档时遇到了一些问题,但不知道如何解决这个问题。我正在使用 PHP 7.2 运行 Ubuntu 18

我在终端收到的错误是

The following packages have unmet dependencies.
 php7.2-zip : Depends: php7.2-common (= 7.2.5-0ubuntu0.18.04.1) but 7.2.5- 
1+ubuntu17.10.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.

任何帮助将不胜感激,谢谢

【问题讨论】:

  • apt-get install php7.2-common php7.2-zip
  • php7.2-common 已经是最新版本(7.2.5-1+ubuntu17.10.1+deb.sury.org+1)。

标签: php ubuntu ziparchive


【解决方案1】:

我尝试使用以下命令更改存储库列表:

http://security.ubuntu.com/ubuntu仿生安全主宇宙 http://archive.ubuntu.com/ubuntu仿生主受限宇宙

但它们似乎都不起作用,但我终于找到了一个可以运行以下命令的存储库

add-apt-repository ppa:ondrej/php

然后使用 apt-get 正常更新和安装包

php7.2-zip Installed

你可以看到它最后安装了。

【讨论】:

    【解决方案2】:

    在 Ubuntu 18.04 上,如果您缺少“security.ubuntu.com/ubuntu bionic-security main Universe”存储库,则可能会发生这种情况。

    将它添加到您的/etc/apt/sources.list,更新然后它会正常安装。

    echo "deb http://security.ubuntu.com/ubuntu bionic-security main universe" >>  
    /etc/apt/sources.list
    apt update
    apt install php7.2-zip
    

    【讨论】:

      猜你喜欢
      • 2019-05-19
      • 2019-07-12
      • 1970-01-01
      • 1970-01-01
      • 2018-05-17
      • 1970-01-01
      • 2019-06-22
      • 2020-03-11
      • 2019-12-14
      相关资源
      最近更新 更多