3

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

3 Answers 3

20

Use the official repository:

sudo add-apt-repository universe
sudo apt update

then:

sudo apt install php7.1-zip
4
  • 1
    This was the exact issue for me. The stock install of 18.04.1 didn't include the universe repository. Spun my wheels on this for a while
    – jrble819
    Aug 31, 2018 at 14:44
  • 1
    Possibly the cleanest solution. Thank you
    – grim
    Oct 31, 2018 at 21:18
  • The default installation of Ubuntu server does not bring the "universe" repository activated. Just activate it and run the apt command again. Nov 12, 2018 at 17:49
  • No luck. 'universe' distribution component is already enabled for all sources.. Still getting E: Package 'libzip4' has no installation candidate
    – toraman
    Jun 8, 2019 at 14:44
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.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.