"Internal Server Error" after apt autoremove / Ubuntu 18.04.5 LTS

[In case someone else runs into this…]

Ubuntu 18.04.5 LTS
Nextcloud version: 20.0.3
Apache v2.4.29
php 7.4.14

Nextcloud failed after running apt autoremove -y

Login page:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

The nextcloud log showed:

"Message":"Failed to connect to the database: An exception occurred in driver: could not find driver"

/var/log/apt/history.log showed that the latest execution of apt autoremove -y had removed php7.4-mysql 2 minutes after upgrading php (and php7.4-mysql !) to v7.4.14.

Reinstalling php7.4-mysql solved the problem:

sudo apt install php7.4-mysql