ubuntu failed to install php-zip extension

When I installed the php-zip extension, the following error message was displayed:

$ sudo apt install php-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:
 php-zip : Depends: php7.2-zip but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Through Google, I found that the solution to the error is simple.

First open vi /etc/apt/sources.list, and then modify the contents as follows:

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

carried out:

sudo apt update

Then execute the installation command.

$ sudo apt install php-zip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
 libzip4 php7.2-zip
The following NEW packages will be installed:
 libzip4 php-zip php7.2-zip
0 upgraded,3 newly installed,0 to remove and 0 not upgraded.
Need to get63.9 kB of archives.
After this operation,204 kB of additional disk space will be used.
Do you want to continue?[Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libzip4 amd64 1.1.2-1.1[37.8 kB]
Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 php7.2-zip amd64 7.2.10-1+ubuntu18.04.1+deb.sury.org+1[20.3 kB]
Get:3 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 php-zip all 1:7.2+62+ubuntu18.04.1+deb.sury.org+3[5,840 B]
Fetched 63.9 kB in2s(39.4 kB/s)   
Selecting previously unselected package libzip4:amd64.(Reading database ...102709 files and directories currently installed.)
Preparing to unpack .../libzip4_1.1.2-1.1_amd64.deb ...
Unpacking libzip4:amd64(1.1.2-1.1)...
Selecting previously unselected package php7.2-zip.
Preparing to unpack .../php7.2-zip_7.2.10-1+ubuntu18.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php7.2-zip(7.2.10-1+ubuntu18.04.1+deb.sury.org+1)...
Selecting previously unselected package php-zip.
Preparing to unpack .../php-zip_1%3a7.2+62+ubuntu18.04.1+deb.sury.org+3_all.deb ...
Unpacking php-zip(1:7.2+62+ubuntu18.04.1+deb.sury.org+3)...
Processing triggers for php7.2-fpm(7.2.10-1+ubuntu18.04.1+deb.sury.org+1)...
Setting up libzip4:amd64(1.1.2-1.1)...
Processing triggers for libc-bin(2.27-3ubuntu1)...
Setting up php7.2-zip(7.2.10-1+ubuntu18.04.1+deb.sury.org+1)...

Creating config file /etc/php/7.2/mods-available/zip.ini withnewversion
Setting up php-zip(1:7.2+62+ubuntu18.04.1+deb.sury.org+3)...
Processing triggers for php7.2-fpm(7.2.10-1+ubuntu18.04.1+deb.sury.org+1)...

reference##

Recommended Posts

ubuntu failed to install php-zip extension
How to install Helm in Ubuntu
How to install Ruby on Ubuntu 20.04
How to install Memcached on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to install MySQL on Ubuntu 20.04
How to install VirtualBox on Ubuntu 20.04
How to install Elasticsearch on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
How to install Nginx on Ubuntu 20.04
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04
How to install Node.js on Ubuntu 16.04
How to install MySQL on Ubuntu 20.04
How to install Vagrant on Ubuntu 20.04
How to install Bacula-Web on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 16.04
How to install Git on Ubuntu 20.04
How to install Anaconda3 on Ubuntu 18.04
How to install mysql in Ubuntu 14.04
How to install Memcached on Ubuntu 18.04
How to install Jenkins on Ubuntu 16.04
How to install MemSQL on Ubuntu 14.04
How to install Go on Ubuntu 20.04
How to install MongoDB on Ubuntu 16.04
How to install Mailpile on Ubuntu 14.04
How to install PrestaShop on Ubuntu 16.04
How to install Skype on Ubuntu 20.04
How to install Jenkins on Ubuntu 20.04
How to install Python 3.8 on Ubuntu 18.04
How to install KVM on Ubuntu 20.04
How to install opencv3.0.0 on ubuntu14.04
How to install Anaconda on Ubuntu 20.04
How to install Prometheus on Ubuntu 16.04
How to install Apache on Ubuntu 20.04
How to install R on Ubuntu 20.04
How to install Moodle on Ubuntu 16.04
How to install Solr 5.2.1 on Ubuntu 14.04
How to install Teamviewer on Ubuntu 16.04
How to install MariaDB on Ubuntu 20.04
How to install Nginx on Ubuntu 20.04
How to install Mono on Ubuntu 20.04
How to install Go on Ubuntu 20.04
How to install Zoom on Ubuntu 20.04
How to install mysql in Ubuntu 14.04
How to install OpenCV on Ubuntu 20.04
How to install Spotify on Ubuntu 20.04
How to install Go 1.6 on Ubuntu 16.04
How to install Go on Ubuntu 18.04
How to install Audacious under Ubuntu
How to install PostgreSQL on Ubuntu 20.04
How to install Tensorflow under ubuntu 16.04
How to install VLC on Ubuntu 18.04
Ubuntu uses Docker to install Gitlab
How to install TeamViewer on Ubuntu 20.04
How to install Webmin on Ubuntu 20.04
How to install Docker Compose on Ubuntu 18.04
How to install Ubuntu on Raspberry Pi
Ubuntu16.04 uses composer to install laravel framework
How to install Bacula Server on Ubuntu 14.04
How to install MySQL on Ubuntu 18.04 (linux)