PHP7.4-MySQL removed automatically after system updates

Asked by Aristotelis Joannou

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
exe 'add-apt-repository -y ppa:ondrej/php' add-apt-repository -y ppa:ondrej/php
exe 'apt-get update' apt-get update

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 :
Start-Date: 2021-02-05 23:00:50
Commandline: apt-get -y install php php-cgi php-cli php-fpm php-mbstring php-mysql php-xml
Install: php8.0-mbstring:amd64 (8.0.1-1+ubuntu20.04.1+deb.sury.org+1, automatic), php8.0-readline:amd64 (8.0.1-1+ubuntu20.04.1+deb.sury.org+1, automatic), php8.0-cgi:amd64 (8.0.1-1+ubuntu20.04.1+deb.sury.org+1, automatic), php8.0-cli:amd64 (8.0.1-1+ubuntu20.04.1+deb.sury.org+1, automatic), php8.0:amd64 (8.0.1-1+ubuntu20.04.1+deb.sury.org+1, automatic), php8.0-fpm:amd64 (8.0.1-1+ubuntu20.04.1+deb.sury.org+1, automatic), php8.0-opcache:amd64 (8.0.1-1+ubuntu20.04.1+deb.sury.org+1, automatic), php8.0-xml:amd64 (8.0.1-1+ubuntu20.04.1+deb.sury.org+1, automatic), php8.0-common:amd64 (8.0.1-1+ubuntu20.04.1+deb.sury.org+1, automatic), php8.0-mysql:amd64 (8.0.1-1+ubuntu20.04.1+deb.sury.org+1, automatic), libapache2-mod-php8.0:amd64 (8.0.1-1+ubuntu20.04.1+deb.sury.org+1, automatic)
Upgrade: php-xml:amd64 (2:7.4+75, 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1), php:amd64 (2:7.4+75, 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1), php-cgi:amd64 (2:7.4+75, 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1), php-cli:amd64 (2:7.4+75, 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1), php-fpm:amd64 (2:7.4+75, 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1), php-mbstring:amd64 (2:7.4+75, 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1), php-mysql:amd64 (2:7.4+75, 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1)
End-Date: 2021-02-05 23:01:27

Wordpress was still functional at this point.

The next day I get this in /var/log/apt/history.log:
Start-Date: 2021-02-06 06:50:14
Commandline: /usr/bin/unattended-upgrade
Remove: php7.4-mysql:amd64 (7.4.14-1+ubuntu20.04.1+deb.sury.org+1)
End-Date: 2021-02-06 06:50:16

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?

Thanks in advance for your help.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

I suggest you contact the PPA maintainer to report the issue.

Revision history for this message
Aristotelis Joannou (conandrum) said :
#2

Hi Andrew,

Do you think this is a ppa:ondrej issue?
Could it be anything else?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

https://packages.ubuntu.com/search?keywords=deb.sury&searchon=names

Well you have lots of "deb.sury" names in the packages which aren't in any names in the official packages. What is the output of:

dpkg -l | grep sury

Thanks

Revision history for this message
Aristotelis Joannou (conandrum) said :
#4

No, thank you Andrew.

ii libapache2-mod-php7.4 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii libapache2-mod-php8.0 8.0.2-1+ubuntu20.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii libargon2-1:amd64 0~20190702-0.1+ubuntu20.04.1+deb.sury.org+1 amd64 memory-hard hashing function - runtime library
ii libgd3:amd64 2.3.0-2+ubuntu20.04.1+deb.sury.org+1 amd64 GD Graphics Library
ii libidn2-0:amd64 2.3.0-1+ubuntu20.04.1+deb.sury.org+2 amd64 Internationalized domain names (IDNA2008/TR46) library
ii libpcre2-16-0:amd64 10.35-5+ubuntu20.04.1+deb.sury.org+1 amd64 New Perl Compatible Regular Expression Library - 16 bit runtime files
ii libpcre2-32-0:amd64 10.35-5+ubuntu20.04.1+deb.sury.org+1 amd64 New Perl Compatible Regular Expression Library - 32 bit runtime files
ii libpcre2-8-0:amd64 10.35-5+ubuntu20.04.1+deb.sury.org+1 amd64 New Perl Compatible Regular Expression Library- 8 bit runtime files
ii libpcre2-dev:amd64 10.35-5+ubuntu20.04.1+deb.sury.org+1 amd64 New Perl Compatible Regular Expression Library - development files
ii libpcre2-posix2:amd64 10.35-5+ubuntu20.04.1+deb.sury.org+1 amd64 New Perl Compatible Regular Expression Library - posix-compatible runtime files
ii libpcre3:amd64 2:8.44-2+ubuntu20.04.1+deb.sury.org+1 amd64 Perl 5 Compatible Regular Expression Library - runtime files
ii libssl-dev:amd64 1.1.1i-1+ubuntu20.04.1+deb.sury.org+4 amd64 Secure Sockets Layer toolkit - development files
ii libssl1.1:amd64 1.1.1i-1+ubuntu20.04.1+deb.sury.org+4 amd64 Secure Sockets Layer toolkit - shared libraries
ii libxml2:amd64 2.9.10+dfsg-5+ubuntu20.04.1+deb.sury.org+3 amd64 GNOME XML library
ii libzip4:amd64 1.7.3-1+ubuntu20.04.1+deb.sury.org+2 amd64 library for reading, creating, and modifying zip archives (runtime)
ii openssl 1.1.1i-1+ubuntu20.04.1+deb.sury.org+4 amd64 Secure Sockets Layer toolkit - cryptographic utility
ii php 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1 all server-side, HTML-embedded scripting language (default)
ii php-cgi 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1 all server-side, HTML-embedded scripting language (CGI binary) (default)
ii php-cli 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1 all command-line interpreter for the PHP scripting language (default)
ii php-common 2:80~exp2+ubuntu20.04.1+deb.sury.org+1 all Common files for PHP packages
ii php-fpm 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1 all server-side, HTML-embedded scripting language (FPM-CGI binary) (default)
ii php-mbstring 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1 all MBSTRING module for PHP [default]
ii php-mysql 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1 all MySQL module for PHP [default]
ii php-pear 1:1.10.12+submodules+notgz-1+ubuntu20.04.1+deb.sury.org+1 all PEAR Base System
ii php-xml 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1 all DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
ii php7.4 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 all server-side, HTML-embedded scripting language (metapackage)
ii php7.4-cgi 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (CGI binary)
ii php7.4-cli 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 command-line interpreter for the PHP scripting language
ii php7.4-common 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 documentation, examples and common module for PHP
ii php7.4-curl 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 CURL module for PHP
ii php7.4-dev 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 Files for PHP7.4 module development
ii php7.4-fpm 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)
ii php7.4-gd 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 GD module for PHP
ii php7.4-intl 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 Internationalisation module for PHP
ii php7.4-json 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 JSON module for PHP
ii php7.4-mbstring 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 MBSTRING module for PHP
rc php7.4-mysql 7.4.14-1+ubuntu20.04.1+deb.sury.org+1 amd64 MySQL module for PHP
ii php7.4-opcache 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 Zend OpCache module for PHP
ii php7.4-readline 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 readline module for PHP
ii php7.4-soap 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 SOAP module for PHP
ii php7.4-xml 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 DOM, SimpleXML, XML, and XSL module for PHP
ii php7.4-xmlrpc 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 XMLRPC-EPI module for PHP
ii php7.4-zip 7.4.15-1+ubuntu20.04.1+deb.sury.org+1 amd64 Zip module for PHP
ii php8.0 8.0.2-1+ubuntu20.04.1+deb.sury.org+1 all server-side, HTML-embedded scripting language (metapackage)
ii php8.0-cgi 8.0.2-1+ubuntu20.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (CGI binary)
ii php8.0-cli 8.0.2-1+ubuntu20.04.1+deb.sury.org+1 amd64 command-line interpreter for the PHP scripting language
ii php8.0-common 8.0.2-1+ubuntu20.04.1+deb.sury.org+1 amd64 documentation, examples and common module for PHP
ii php8.0-fpm 8.0.2-1+ubuntu20.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)
ii php8.0-mbstring 8.0.2-1+ubuntu20.04.1+deb.sury.org+1 amd64 MBSTRING module for PHP
ii php8.0-mysql 8.0.2-1+ubuntu20.04.1+deb.sury.org+1 amd64 MySQL module for PHP
ii php8.0-opcache 8.0.2-1+ubuntu20.04.1+deb.sury.org+1 amd64 Zend OpCache module for PHP
ii php8.0-readline 8.0.2-1+ubuntu20.04.1+deb.sury.org+1 amd64 readline module for PHP
ii php8.0-xml 8.0.2-1+ubuntu20.04.1+deb.sury.org+1 amd64 DOM, SimpleXML, XML, and XSL module for PHP

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

Ok, what is the output of:

apt-cache policy php-mysql

Revision history for this message
Aristotelis Joannou (conandrum) said :
#6

php-mysql:
  Installed: 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1
  Candidate: 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1
  Version table:
 *** 2:8.0+80~exp2+ubuntu20.04.1+deb.sury.org+1 500
        500 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status
     2:7.4+75 500
        500 http://mirrors.digitalocean.com/ubuntu focal/main amd64 Packages

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#7

So yeah. You installed a truckload of packages from a source you have no idea about and got issues.... I'd contact the maintainer.

Revision history for this message
Aristotelis Joannou (conandrum) said :
#8

This is the source https://answers.launchpad.net/~ondrej
I sent him a personal message on the above page (Contact this user).

For Ubuntu, his package comes up as the proper way of maintaining multiple PHP versions on a single server.
Do you know of any better way of doing this?

Revision history for this message
Manfred Hampl (m-hampl) said :
#9

As far as I can see all involved packages have a version number containing "deb.sury.org", so this has to be discussed with the provider of the PPA.

One hint for "how do I avoid it happening again":
Adding a PPA without checking which updates it brought, but letting unattended-upgrades do the updates later is like asking for troubles.
And maybe another one:
Avoid PPAs if possible.

Revision history for this message
Aristotelis Joannou (conandrum) said :
#10

Thanks Manfred.

Do you know of a better way I can maintain multiple PHP versions on Ubuntu without using this PPA?

Revision history for this message
Manfred Hampl (m-hampl) said :
#11

Why do you need different php versions?

Revision history for this message
Aristotelis Joannou (conandrum) said :
#12

For development purposes.
When testing different software I usually have various folders each with a different PHP version.
But this is besides the point... Is there a better alternative that you could recommend?

Can you help with this problem?

Provide an answer of your own, or ask Aristotelis Joannou for more information if necessary.

To post a message you must log in.