Apache cannot start; Update failed to remove apache2-mod_php7

A recent update process to Tumbleweed 20221221:

zypper dup --download-only

followed by

zypper dup

fails when attempting to remove the “apache2-mod_php7” package. What I get in the log file created during the second stage (“zypper dup”) is:

(154/226) Removing apache2-mod_php7-7.4.33-2.1.x86_64 [...
error: %preun(apache2-mod_php7-7.4.33-2.1.x86_64) scriptlet failed, exit status 1
error: apache2-mod_php7-7.4.33-2.1.x86_64: erase failed
.error]
Removal of (73094)apache2-mod_php7-7.4.33-2.1.x86_64(@System) failed:
Error: Subprocess failed. Error: RPM failed: Command exited with status 1.
Abort, retry, ignore? [a/r/i] (a):

Trying to remove the package “by hand” using:

rpm -qa | grep php7    # find complete package name
rpm -e apache2-mod_php7-7.4.33-2.1.x86_64

returns the same result: scriptlet failed, exit status 1, erase failed.

Q1: Where is the scriptlet saved on disk? My hope is that following the steps it is attempting to use to remove that package can be issued by hand and whatever error it’s encountering can be worked around.

Q2: If the package can, eventually, be removed by hand, what other steps would need to be taken to make sure the RPM database is left in the correct state where that package is no longer assumed to be on the system?

I’d like to get several virtual web services – that have been down due to this problem for nearly a week – back up and online.

TIA…

I’ve never dealt with such an issue, but man rpm gave me the following suggestions that you may try:

A1: rpm -q --scripts apache2-mod_php7-7.4.33-2.1.x86_64 will show the scriptlets

A2: rpm -e --noscripts apache2-mod_php7-7.4.33-2.1.x86_64 might do the remove without running any script.

The commands above are without any guarantee, as I do not have package apache2-mod_php7 installed. For further info, man rpm is your friend.

PCU,

Thanks. I found the manpage description of “–noscripts” (“A2”) first and was able to remove the mod_php7-related package. That didn’t allow Apache2 to start, though. There was still a complaint that I needed to recompile the apache2-mod_php7. So, I tarred up the /etc/apache2 tree, removed apache2 (yeah, thanks YaST, I know it breaks LAMP), re-installed Apache2, and restored the config files from the tar archive. Virtual servers started right up.

I wish I’d seen “–scripts” (i.e., “A1”) first as I’ve never looked at the scriptlets before. Now I’m curious as to what they do during the “rpm -e” process.

Anyway… thanks.

Tumbleweed 20221221 doesn’t any packages related to php7

erlangen:~ # zypper se -is php7
Loading repository data...
Reading installed packages...
No matching items found.

It needs php8:

erlangen:~ # zypper se -is php8
Loading repository data...
Reading installed packages...

S | Name             | Type    | Version    | Arch   | Repository
--+------------------+---------+------------+--------+------------------------
i | apache2-mod_php8 | package | 8.1.13-2.1 | x86_64 | openSUSE-Tumbleweed-Oss
i | php8             | package | 8.1.13-2.1 | x86_64 | openSUSE-Tumbleweed-Oss
erlangen:~ # 

You may try Cleanup of distribution upgrades