Unable to install PHP zip archive with PHP 7.2

userdrupa4356 picture userdrupa4356 · Jun 13, 2018 · Viewed 11.8k times · Source

I am running into some issues installing the PHP zip archive and not sure how to fix this. I am running Ubuntu 18 with PHP 7.2

The error I receive in terminal is

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.

Any help would be appreciated, thanks

Answer

Jonathan picture Jonathan · Jan 2, 2019

I tried changing the repository list with:

http://security.ubuntu.com/ubuntu bionic-security main universe http://archive.ubuntu.com/ubuntu bionic main restricted universe

But none of them seem to work, but I finally found a repository that works running the following command

add-apt-repository ppa:ondrej/php

And then updating and installing normally the package using apt-get

php7.2-zip Installed

As you can see its installed at last.