Need To Reinstall Mariadb

OS type and version Ubuntu 22.04
Virtualmin version 7.7

Hi All,

I’ve had Virtualmin running for a couple of weeks, with just my one website, haven’t made any odd changes - some tweaks which hopefully are in the config backup I ran yesterday.

I’ve been moving my entire LAN from windows to Ubuntu for the last couple of months, with a lot of experimentation to get where I want to be. After finally settling on a core OS version, my experiments have been on another machine. I assume you are familiar with Synaptic Package Manager, which I used to get an environment I am comfortable with and which does what I need. When done (this morning) I used the Generate package download script which I copied to my server and ran, giving me the entirety of packages on that box (exactly the same OS). Upon running the script via “Add downloaded packages” everything ran smoothly, except I noticed it removed Mariadb. I’ve verified this via the Dashboard.

My site (i.e., Apache & PHP) is still running perfectly, save my DataTables (dozens of them) which no longer connect to any data sources, of course. Thanks to Joe, my site is on an external drive mounted as home, and I’ve already made copies of the mysql data directory (/var/bin/mysql I think?) on the same drive.

So now, do I reinstall VirualMin and rely on the config backup? Or…how do I get Mariadb back, as there is no install script for it and VirtualMin still restarts the Mariadb service, but its obviously gone under any Edit Database pages…

As always, much thanks for your help:)

Do you get a error when you re-check config?

That sounds dangerous, if you’re not paying close attention to what dependencies it is pulling in and what conflicts are being resolved. Sounds like you installed something that conflicts with mariadb, and thus, dpkg uninstalled mariadb, as you requested.

You really have to pay attention when installing and removing software, as the automatic dependency resolution and conflicts can cause quite a lot of damage to a production system.

You may or may not be able to simply install the packages again. Depending on how you removed them, though, you may have also deleted all of your data, in which case, there’s nothing to be done except restore the databases from backups (and if you don’t have backups, there’s nothing to be done). Since you don’t know how you uninstalled it, I don’t either. I’m just guessing it was a conflict.

You can reinstall the Virtualmin stack by running (for an Apache-based system, the default):

apt install virtualmin-lamp-stack

Or (for an nginx-based system, if you used the -b LEMP option when installing Virtualmin):

apt install virtualmin-lemp-stack

Obviously do not run whichever one does not apply to your system, as it will cause more destruction.

This may ask to remove some of the packages you installed via your Synaptic package list, since the reason you’re in this mess is probably because you installed some stuff that conflicted with mariadb.

Thanks kindly, Joe.

I’m running apt install virtualmin-lamp-stack as I write since “Re-Check Configuration” said VirtualMin was “not ready” with a couple of errors including SendMail (not sure why there…)…

Honestly? What I did was completely irresponsible and if an employee ever did such a thing, he or she would deserve a pink slip.

Something I installed added some Rsync packages, at which point I was asked to configure a MySQL database with some creds. There is a mysql installation I did not put on the box now, so that is my suspicion re: mariadb being deleted.

Some errors from the virtualmin-lamp-stack terminal:

dpkg: sendmail-bin: dependency problems, but removing anyway as you requested:
 sensible-mda depends on sendmail-bin | mail-transport-agent; however:
  Package sendmail-bin is to be removed.
  Package mail-transport-agent is not installed.
  Package sendmail-bin which provides mail-transport-agent is to be removed.
  Package postfix which provides mail-transport-agent is not installed.
 sensible-mda depends on sendmail-bin | mail-transport-agent; however:
  Package sendmail-bin is to be removed.
  Package mail-transport-agent is not installed.
  Package sendmail-bin which provides mail-transport-agent is to be removed.
  Package postfix which provides mail-transport-agent is not installed.

Not an error, but I could use some guidance with this one, please:

Postfix ( is now set up with the changes above.  If you need to make 
changes, edit /etc/postfix/ (and others) as needed.  To view Postfix 
configuration values, see postconf(1).

After modifying, be sure to run 'systemctl reload postfix'.

I do recall seeing some “postfix” errors in my first attempts at recovering after my stupidiy, but I didn’t understand what I was being told/asked to do.

Synchronizing state of proftpd.service with SysV service script with /lib/system
Executing: /lib/systemd/systemd-sysv-install enable proftpd
Failed to enable unit: Unit file /etc/systemd/system/proftpd.service is masked.
dpkg: error processing package proftpd-core (--configure):
 installed proftpd-core package post-installation script subprocess returned err
or exit status 1
Setting up php-mysql (2:8.1+92ubuntu1) ...
Setting up php8.1-mbstring (8.1.2-1ubuntu2.11) ...
Setting up dovecot-pop3d (1:2.3.16+dfsg1-3ubuntu2.2) ...
Setting up python3-s3transfer (0.5.0-1) ...
Setting up libtype-tiny-perl (1.012004-1) ...
Setting up libnet-dns-perl (1.33-1) ...
Setting up php-mbstring (2:8.1+92ubuntu1) ...
Setting up python3-zope.component (4.3.0-3) ...
dpkg: dependency problems prevent configuration of proftpd-mod-crypto:
 proftpd-mod-crypto depends on proftpd-core (= 1.3.7c+dfsg-1build1); however:
  Package proftpd-core is not configured yet.

dpkg: error processing package proftpd-mod-crypto (--configure):
 dependency problems - leaving unconfigured
Setting up libnet-server-perl (2.009-2) ...
No apport report written because the error message indicates its a followup erro
r from a previous failure.
                          dpkg: dependency problems prevent configuration of pro
 proftpd-mod-wrap depends on proftpd-core (= 1.3.7c+dfsg-1build1); however:
  Package proftpd-core is not configured yet.

dpkg: error processing package proftpd-mod-wrap (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup erro
r from a previous failure.
                          Setting up milter-greylist (4.6.4-1) ...
Setting up php8.1-cli (8.1.2-1ubuntu2.11) ...
update-alternatives: using /usr/bin/php8.1 to provide /usr/bin/php (php) in auto
update-alternatives: using /usr/bin/phar8.1 to provide /usr/bin/phar (phar) in a
uto mode
update-alternatives: using /usr/bin/phar.phar8.1 to provide /usr/bin/phar.phar (
phar.phar) in auto mode
Setting up python3-acme (1.21.0-1ubuntu0.1) ...
Setting up clamav-freshclam (0.103.8+dfsg-0ubuntu0.22.04.1) ...
Setting up postgrey (1.36-5.2) ...
dpkg: dependency problems prevent configuration of proftpd-basic:
 proftpd-basic depends on proftpd-core; however:
  Package proftpd-core is not configured yet.
 proftpd-basic depends on proftpd-mod-wrap; however:
  Package proftpd-mod-wrap is not configured yet.
 proftpd-basic depends on proftpd-mod-crypto; however:
  Package proftpd-mod-crypto is not configured yet.

dpkg: error processing package proftpd-basic (--configure):
 dependency problems - leaving unconfigured
Setting up python3-certbot (1.21.0-1build1) ...
No apport report written because MaxReports is reached already

Error in /usr/share/doc-base/clamav-docs.clamav-docs', line 9: all Format’ sec
tions are invalid.
Note: `install-docs --verbose --check file_name’ may give more details about the
above error.

NOTICE: Not enabling PHP 8.1 FPM by default.
NOTICE: To enable PHP 8.1 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php8.1-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Errors were encountered while processing:
[master fcd0128] committing changes in /etc made by “apt install virtualmin-lamp-stack”
Author: shawn shawn@blahblahblah

E: Sub-process /usr/bin/dpkg returned an error code (1) 

Upon re/starting the servers via Dashboard, only Sendmail Mail Server and ProFTPD FTP Server fail to start. After re-enabling my domain and clearing the browser cache, my site is back up, including the dbs:)

Lastly, Re-Check Configuration is giving approximately the same error after running “Refresh Modules”:

The status of your system is being checked to ensure that all enabled features are available and properly configured …

Your system has 15.04 GiB of memory, which is at or above the Virtualmin recommended minimum of 256 MiB

BIND DNS server is installed

No address mapping (virtusers) file was found in your Sendmail configuration. Your may need to add the appropriate feature your Sendmail M4 and re-build the configuration.

… your system is not ready for use by Virtualmin

So, I’m up and running again (Thanks, Joe!) but it seems I still have some gremlins. I’ve never been able to get mail to send though (even following various tutorials), so I’m basically where I was before my unbelievable and unacceptable stupidity. Maybe the mail issue is related to your firewall, which I’ve completely disabled because samba doesn’t let my LAN access shares when FirewallD is enabled…both of which are my top-of-list ToDos.

Once again, thanks for saving my as…bum:)

lol. We won’t be firing you today, but try to keep the “yolo” activities to a minimum on production servers.

It seems like your package installation process removed Postfix and installed Sendmail, which is a core part of the default Virtualmin installation. That would have also led to the removal of virtualmin-lamp-stack. If you followed up with an apt autoremove you would have wiped out a lot of stuff, maybe the whole Virtualmin install (since the Virtualmin install is driven by dependencies and metapackages).

You should not switch core parts of the system to something else, unless you really know what you’re doing and why. Sendmail is supported by Virtualmin, the software, but I just don’t have the expertise to support it in any meaningful way here in the forums. I have exclusively been a Postfix user for 2+ decades. I don’t recommend you switch to Sendmail.

You really won’t be able to send mail now. You’ve removed the mail server (and installed a different one, but it’s completely unconfigured for use with Virtualmin or for virtual domain hosting). You should reinstall Postfix.

OK. I have no bias towards any particular system for mail, so whatever you recommend, I will use.

Is there any way for me to ask the system as a whole, “What’s working, what’s conflicting, what’s missing, and what do you recommend be removed?” (I thought Synaptic was kinda-sorta capable of that, but I suppose Synaptic also assumes there’s not a blind person at the wheel…)

The real problem is, after several decades on (seemingly) hermetically-sealed Windows boxes, now having 4 Linux boxes leaves me feeling like an unmedicated ADHD kid in an infinitely large candy store, so to speak. Lots (and lots and lots) to learn.

I’ll get to work on Postfix right now…

P.S., I finally understand what you mean about permissions with vfat USB storage and fstab. I’ve seemingly got a handle on my ext4 drives now, but trying to transfer from vfat drives to ext4 (single drives, software RAID10 and hardware RAID1) is a 24/7 hourly problem right now. The closest I’ve come is to mount the vfat drives with default properties (“UUID=DA50-XXXX /media/images vfat defaults 0 0” in fstab) but doing so leaves me devoid of any file-modification, cut/paste or Move-To abilities…it’s a real pain. I’m aware of umask, dmask and fmask but trying to speed up the data move by setting everything to full permissions for everyone (e.g. "UUID=DA50-XXXX /media/images vfat defaults, umask=000, dmask=000, fmask=000 0 0") just hangs my system and doesn’t apply the permissions changes. With many millions of files on half-a-dozen Windows drives, trying to move that data to ext4 drives, I’m pulling my hair out lol.

The package manager can tell you what is installed (and package management is remarkably better on Linux than on Windows…hell, Windows only recently got an actual package manager). And, it can prevent conflicts (that’s what it did when it removed Postfix) and resolve dependencies (that’s what you’re seeing with some of those other errors).

But, here’s the thing…you told it to install Sendmail. As far as the package manager is concerned, when it successfully installs things you told it to install, everything is correct. There’s nothing that can protect your system from you telling it to do something. You wanted Sendmail, you got Sendmail. All the tools did their job.

And, Virtualmin has a whole bunch of checks, and you saw that when it warned you about a problem with Sendmail, though Virtualmin thought you were intending to use Sendmail, since you’d installed Sendmail and removed Postfix. Again, it can’t protect you from intentionally changing what software you have installed.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.