PHP7.4-MySQL removed automatically after system updates

Hi all,

This is a fresh system (05 Feb 2021) with
Operating system Ubuntu Linux 20.04.2
Webmin version 1.962 Usermin version 1.812 Virtualmin version 6.14
Kernel and CPU Linux 5.4.0-65-generic on x86_64

Webmin installed MySQL & PHP 7.4
I then enabled multiple PHP versions using

By 22:44 I finished configuring the server.
I then installed Wordpress and made sure it was functioning properly.

The system has automatic updates enabled in /etc/apt/apt.conf.d/60unattended-upgrades.

So at 23:00 PHP 8.0 got installed automatically - I got this in /var/log/apt/history.log :

Wordpress was still functional at this point.

The next day I get this in /var/log/apt/history.log:

So today I go to check Wordpress and of course it is not working because there is no php7.4-mysql
When I switch PHP to version 8.0 it works fine.

Why is this happening and how do I avoid it happening again?

@Rory_Bremner1,

Technically the unattended upgrade seems have done what it was supposed to. If 7.4 was the previous default and 8.0 superceded it, then it’s logical the installation of 8.0 would trigger a removal of 7.4.

WordPress should work with 8.0 as I understand the core of the product has been updated. However some plugins may still not be ready which is the only potential con.

Since my experience with multiple PHP versions under Debian/Ubuntu lacks I’ll defer this matter @unborn who’s got more mileage with these distros.

*** He should be notified of this posting and will likely respond within 6-12 hours depending on how busy he is. ***

Best Regards,
Peter Knowles | TPN Solutions

Most of the plugins I’m using are just now becoming 7.4 compliant and many are still running in 7.2. I don’t understand everybody’s race to 8.0.

Hi @Rory_Bremner1 generally speaking out of public, you as system administrator should never apply automatic updates, it’s Ill advice and bad decision, you should update always manually specially with Ubuntu. I do support debian issues but Ubuntu modify os so much that it’s mess. Sorry for the late response but I couldn’t help with Ubuntu server specially with suicide auto updates. Best shot would be to ask @Joe or @andreychek… Or the last one… Basically virtualmin staff. But never do automatic updates…

Good advise, thank you.
Regarding your comments on automatic updates for Ubuntu, let me offer also my own personal experience with Ubuntu 18.04. For over 2 years now I have had automatic updates enabled with zero ill effects. I only experienced this issue on 20.04 (brand new server). It uninstalled ONLY php7.4-mysql. Very weird.
Unfortunately the ppa:ondrej administrator couldn’t provide any further insights into the problem. He only stated the following:

“Install it by hand, so it’s not pulled as dependency to php-mysql.
The version-less packages depend on latest stable. If you need to keep specific version you’ll need to install versioned packages.”

This is all very good and understood. But I still have this question in my head:

Why is this not happening with other packages like xml, xsl, xmlwriter etc? Why only with php-mysql?
Should I be worried that other packages may be auto removed in the future?
On another server I have Ubuntu 18.04 which came with php7.2 before I installed ppa:ondrej/php - That server did not remove anything after php8.0 got installed.
Just was curious why this was happening only with php7.4-mysql and only on 20.04 Ubuntu.

@Rory_Bremner1 hi don’t get me wrong buts this is why I do recommend update by manually… It may works for years but one day at one time it can bring sky falling on your head… Just that one time at random day or time… So to be just sure, make sure you see what it’s going on and when terminal ask you, make decision, not like automatic updates where there isn’t reply = default choice is happening as its automatic… Why not other packages? That’s pointing to Ubuntu as they make lots of mods and sometimes as Ubuntu does think, for users… I would say stay very close to source, when you cold, you go nearest to the fire… Same with distro… Want really reliable thing based on Debian? Go debian, you would not have any issues, besides to say for my self, I’m running virtualmin on from debian 6 without reinstall… Some mods to apache config very little and its done. Now on Debian 10…all just log in every 10th month to just apt update and apt upgrade - y command… Worth for me.

Well 18.4 is not supposed to be supported i guess? Not sure about it… Ubuntu is bleeding edge os things can break, it’s Ubuntu :smirk: