Php installation error

when I execute

apt update && apt upgrade
When

, you accidentally choose the wrong option, which causes the PHP upgrade to fail

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up libapache2-mod-php7.2 (7.2.7-1+ubuntu18.04.1+deb.sury.org+1) ...
ucfr: Attempt from package libapache2-mod-php7.2  to take /etc/php/7.2/apache2/php.ini away from package php7.2-fpm
ucfr: Aborting.
dpkg: error processing package libapache2-mod-php7.2 (--configure):
 installed libapache2-mod-php7.2 package post-installation script subprocess returned error exit status 4
Errors were encountered while processing:
 libapache2-mod-php7.2
E: Sub-process /usr/bin/dpkg returned an error code (1)
When

, in addition to prompting
, it is also the same when you use apt later

and it doesn"t work anyway
and execute

apt-get autoremove
apt autoremove
apt-get clean
apt clean

dpkg -l |grep ^rc|awk "{print $2}" |xargs dpkg -P
After

, the same error is prompted, and the following prompts are added

dpkg: error processing package libapache2-mod-php7.2 (--configure):
 installed libapache2-mod-php7.2 package post-installation script subprocess returned error exit status 4
Errors were encountered while processing:
 libapache2-mod-php7.2
E: Sub-process /usr/bin/dpkg returned an error code (1)
dpkg: error: --purge needs at least one package name argument

Type dpkg --help for help about installing and deinstalling packages [*];
Use "apt" or "aptitude" for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through "less" or "more" !

I would like to ask you guys, what should I do

-sharp uname -a
Linux dz6 4.4.0-122-generic -sharp146-Ubuntu SMP Mon Apr 23 15:34:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
-sharp lsb_release -a
LSB Version:    core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID:    Ubuntu
Description:    Ubuntu 18.04 LTS
Release:    18.04
Codename:    bionic
Mar.24,2021

compile and install it yourself, or pull an image with docker. A previously written shell: LnmpShell


uninstalls the wrong package and reinstalls it. When autoremve does not add the package name, it will only delete the automatically selected package that is not dependent, and will not delete the package installed manually. You need to add the name of the package.

Menu