While running sudo apt-get install php7.4-zip
, I encountered the following error:
The following packages have unmet dependencies: php7.4-zip: Depends on php7.4-common (=7.4.3-4ubuntu2.12), but to install version 7.4.10-1 ubuntu18.04.1 deb.sury.org 1 E: The problem cannot be corrected. There are corrupt packages on your system.
The page in the PHP manual about installing the Zip extension is as follows:
Starting with PHP 7.4.0, in order to use these functions, you must compile PHP with zip support using the --with-zip configuration option. Previously, zip support had to be enabled using the --enable-zip configuration option. Starting with PHP 7.4.0, the bundled libzip has been removed.
Is there any direct way to install the Zip extension on my system?
Update: Additional information:
dpkg --get-selections | grep hold
Returns packages that are not retained. sudo apt autoremove
removed some packages, but did not change the message returned by sudo apt install php7.4-zip
.
The following steps work fine on my Ubunut 22 and php7.4. Add PPA to get PHP 7.4 which also contains other required PHP extensions.
You can then install the extension