正如标题已经说明的那样,我需要在Ubuntu 18.04下从php 7.1安装zip模块。每当我使用命令
sudo apt-get install php7.1-zip
和下面的输出。
Reading package lists... Done
Building dependency tree
Reading state information... Done
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:
php7.1-zip : Depends: libzip4 (>= 1.0) but it is not installable
E: Unable to correct problems, you have held broken packages.
尝试安装libzip4
也不起作用。
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libzip4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libzip4' has no installation candidate
有人可以帮忙吗?不幸的是,谷歌也没有帮助。
Elias
答案 0 :(得分:16)
使用官方存储库:
sudo add-apt-repository universe
sudo apt update
然后:
sudo apt install php7.1-zip
答案 1 :(得分:0)
一个临时解决方案是仅从受信任的源下载程序包文件,例如: https://packages.ubuntu.com/xenial/libzip4
然后,使用
进行安装dpkg -i libzip4_1.0.1-0ubuntu1_amd64.deb
php7.1-zip
将正常安装。
答案 2 :(得分:-1)
请尝试以下操作:
如果您使用的是64位,请执行以下操作:
sudo apt-get purge libzip4
然后:
sudo apt-get install php7.1-zip
如果您使用的是32位系统,则:
sudo apt-get install php7.1-zip:i386