PHP updates causes error

Operating system:
OS version:
Ubuntu Linux 18.04.5

Building complete list of packages …

Now updating libapache2-mod-php8.0 php7.4 php7.4-cgi php7.4-cli php7.4-common php7.4-curl php7.4-gd php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-xml php7.4-zip php8.0 php8.0-cgi php8.0-cli php8.0-common php8.0-curl php8.0-fpm php8.0-gd php8.0-mbstring php8.0-mysql php8.0-opcache php8.0-readline php8.0-xml php8.0-zip …

Installing package(s) with command apt-get -y install libapache2-mod-php8.0 php7.4 php7.4-cgi php7.4-cli php7.4-common php7.4-curl php7.4-gd php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-xml php7.4-zip php8.0 php8.0-cgi php8.0-cli php8.0-common php8.0-curl php8.0-fpm php8.0-gd php8.0-mbstring php8.0-mysql php8.0-opcache php8.0-readline php8.0-xml php8.0-zip ..

dpkg: error processing package php7.4-json (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
dpkg: dependency problems prevent processing triggers for php7.4-fpm:
 php7.4-fpm depends on php7.4-json; however:
  Package php7.4-json is not configured yet.

dpkg: error processing package php7.4-fpm (--configure):
 dependency problems - leaving triggers unprocessed
dpkg: dependency problems prevent processing triggers for libapache2-mod-php7.4:
 libapache2-mod-php7.4 depends on php7.4-json; however:
  Package php7.4-json is not configured yet.

dpkg: error processing package libapache2-mod-php7.4 (--configure):
 dependency problems - leaving triggers unprocessed
Errors were encountered while processing:
 php7.4-json
 php7.4-fpm
 libapache2-mod-php7.4
Reading package lists...
Building dependency tree...
Reading state information...
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libapache2-mod-php7.4 : Depends: php7.4-common (= 7.4.21-1+ubuntu18.04.1+deb.sury.org+1) but 7.4.22-1+ubuntu18.04.1+deb.sury.org+1 is to be installed
 php7.4-fpm : Depends: php7.4-common (= 7.4.21-1+ubuntu18.04.1+deb.sury.org+1) but 7.4.22-1+ubuntu18.04.1+deb.sury.org+1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

.. install failed!

No packages were installed. Check the messages above for the cause of the error.

Im new, I tried to run apt --fix-broken install in webmin command shell, any advise please?

using the command in Virtual min, when I run sudo apt --fix-broken install
I get the following…
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists…
Building dependency tree…
Reading state information…
Correcting dependencies… Done
The following packages were automatically installed and are no longer required:
apt-show-versions libapt-pkg-perl linux-headers-4.15.0-112
linux-headers-4.15.0-112-generic linux-headers-4.15.0-118
linux-headers-4.15.0-118-generic linux-headers-4.15.0-121
linux-headers-4.15.0-121-generic linux-headers-4.15.0-122
linux-headers-4.15.0-122-generic linux-headers-4.15.0-123
linux-headers-4.15.0-123-generic linux-headers-4.15.0-124
linux-headers-4.15.0-124-generic linux-headers-4.15.0-126
linux-headers-4.15.0-126-generic linux-headers-4.15.0-128
linux-headers-4.15.0-128-generic linux-headers-4.15.0-129
linux-headers-4.15.0-129-generic linux-headers-4.15.0-130
linux-headers-4.15.0-130-generic linux-headers-4.15.0-132
linux-headers-4.15.0-132-generic linux-headers-4.15.0-134
linux-headers-4.15.0-134-generic linux-headers-4.15.0-135
linux-headers-4.15.0-135-generic linux-headers-4.15.0-136
linux-headers-4.15.0-136-generic linux-headers-4.15.0-137
linux-headers-4.15.0-137-generic linux-headers-4.15.0-139
linux-headers-4.15.0-139-generic linux-headers-4.15.0-140
linux-headers-4.15.0-140-generic linux-headers-4.15.0-141
linux-headers-4.15.0-141-generic linux-headers-4.15.0-142
linux-headers-4.15.0-142-generic linux-headers-4.15.0-143
linux-headers-4.15.0-143-generic linux-headers-4.15.0-144
linux-headers-4.15.0-144-generic linux-headers-4.15.0-76
linux-headers-4.15.0-76-generic linux-image-4.15.0-112-generic
linux-image-4.15.0-118-generic linux-image-4.15.0-121-generic
linux-image-4.15.0-122-generic linux-image-4.15.0-123-generic
linux-image-4.15.0-124-generic linux-image-4.15.0-126-generic
linux-image-4.15.0-128-generic linux-image-4.15.0-129-generic
linux-image-4.15.0-130-generic linux-image-4.15.0-132-generic
linux-image-4.15.0-134-generic linux-image-4.15.0-135-generic
linux-image-4.15.0-136-generic linux-image-4.15.0-137-generic
linux-image-4.15.0-139-generic linux-image-4.15.0-140-generic
linux-image-4.15.0-141-generic linux-image-4.15.0-142-generic
linux-image-4.15.0-143-generic linux-image-4.15.0-144-generic
linux-image-4.15.0-76-generic linux-modules-4.15.0-112-generic
linux-modules-4.15.0-118-generic linux-modules-4.15.0-121-generic
linux-modules-4.15.0-122-generic linux-modules-4.15.0-123-generic
linux-modules-4.15.0-124-generic linux-modules-4.15.0-126-generic
linux-modules-4.15.0-128-generic linux-modules-4.15.0-129-generic
linux-modules-4.15.0-130-generic linux-modules-4.15.0-132-generic
linux-modules-4.15.0-134-generic linux-modules-4.15.0-135-generic
linux-modules-4.15.0-136-generic linux-modules-4.15.0-137-generic
linux-modules-4.15.0-139-generic linux-modules-4.15.0-140-generic
linux-modules-4.15.0-141-generic linux-modules-4.15.0-142-generic
linux-modules-4.15.0-143-generic linux-modules-4.15.0-144-generic
linux-modules-4.15.0-76-generic linux-modules-extra-4.15.0-112-generic
linux-modules-extra-4.15.0-118-generic
linux-modules-extra-4.15.0-121-generic
linux-modules-extra-4.15.0-122-generic
linux-modules-extra-4.15.0-123-generic
linux-modules-extra-4.15.0-124-generic
linux-modules-extra-4.15.0-126-generic
linux-modules-extra-4.15.0-128-generic
linux-modules-extra-4.15.0-129-generic
linux-modules-extra-4.15.0-130-generic
linux-modules-extra-4.15.0-132-generic
linux-modules-extra-4.15.0-134-generic
linux-modules-extra-4.15.0-135-generic
linux-modules-extra-4.15.0-136-generic
linux-modules-extra-4.15.0-137-generic
linux-modules-extra-4.15.0-139-generic
linux-modules-extra-4.15.0-140-generic
linux-modules-extra-4.15.0-141-generic
linux-modules-extra-4.15.0-142-generic
linux-modules-extra-4.15.0-143-generic
linux-modules-extra-4.15.0-144-generic linux-modules-extra-4.15.0-76-generic
Use ‘sudo apt autoremove’ to remove them.
The following additional packages will be installed:
libapache2-mod-php7.4 php7.4-cgi php7.4-cli php7.4-common php7.4-curl
php7.4-fpm php7.4-gd php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache
php7.4-readline php7.4-xml php7.4-zip
The following packages will be upgraded:
libapache2-mod-php7.4 php7.4-cgi php7.4-cli php7.4-common php7.4-curl
php7.4-fpm php7.4-gd php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache
php7.4-readline php7.4-xml php7.4-zip
14 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.
1 not fully installed or removed.
Need to get 0 B/7,439 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Abort.

why does it say abort immediately? I cant seem to type Y

Is it better to SSH directly instead of using the command in Virtualmin?

You should not be installing mod_php, ever. There is no reason to use mod_php today.

I don’t know if that’ll help resolve your issue, but mod_php is always a mistake.

I guess it’s because there was a warning about this at the top of the output, and you probably missed or didn’t understand it:

Use a standard console using ssh in a Linux terminal, or PuTTY on Windows.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.