php-zip拡張機能をインストールすると、次のエラーメッセージが表示されました。
$ 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.
Googleを通じて、エラーの解決策は簡単であることがわかりました。
最初に vi / etc / apt / sources.list
を開き、次に内容を次のように変更します。
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
実施した:
sudo apt update
次に、インストールコマンドを実行します。
$ 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)...
Recommended Posts