Ubuntu LTS 22.04 (MariaDB vs MySQL)

The thing is, that our stack package for Virtualmin 6 has MySQL set as a dependency in virtualmin-lemp-stack. Any time it’s updated it will remove MariaDB and install MySQL completely messing up your databases. On contrary Virtualmin 7 has MariaDB on the stack.

In your specific case this can be prevented by switching to VIrtualmin 7 repos using beta version of install.sh script and running it with --setup switch (to setup repos and exit). Although, the new (beta) install script has a protection against setting up Virtualmin 7 repos on Virtualmin 6 installs. Therefore, before setting up repos with install script as mentioned above you would have to manually unlink /etc/apt/sources.list.d/virtualmin.list file. When this done, setup repos and then run apt-get upgrade --dry-run and see what package manager would be saying. If it doesn’t say (in your case) that MariaDB would be uninstalled then you’re good go.