php7.1-zip installation under Ubuntu 18.04

感情迁移 提交于 2020-01-29 17:48:20

问题


as the title already explains I need to install the zip module from php 7.1 under Ubuntu 18.04. When every I use the command

sudo apt-get install php7.1-zip

and the follwing output.

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.

Trying to Install libzip4 does not work either.

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

Can somebody please try to help. Google does not help with unfortunately either.

Elias


回答1:


A temporary solution is to just download the package file from trusted source like: https://packages.ubuntu.com/xenial/libzip4

Afterwards, install it with

dpkg -i libzip4_1.0.1-0ubuntu1_amd64.deb

And the php7.1-zip will install gracefully.




回答2:


Use the official repository:

sudo add-apt-repository universe
sudo apt update

then:

sudo apt install php7.1-zip



回答3:


Please try with the following:

if you are using 64-bit then do:

sudo apt-get purge libzip4

then:

sudo apt-get install php7.1-zip

if you are using 32-bit system then:

sudo apt-get install php7.1-zip:i386


来源:https://stackoverflow.com/questions/51731062/php7-1-zip-installation-under-ubuntu-18-04

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!