MariaDB upgrade process is removing Postfix

SYSTEM INFORMATION
OS type and version Centos 7
Virtualmin version R7.5

Hello, Postfix that is installed automatically via virtualmin works fine but I had to upgrade my mariadb from 5.x to 10.11.2 and I noticed that the below command is removing Postfix
yum remove mariadb-server mariadb mariadb-libs

So, I go to the Webmin, Servers , Postfix Server and I click on Install Postfix or via command line virtualmin-config-system -i Postfix to make the installation everything goes fine but it doesnt work any more I tried to reinstall the server several times. Is there any way to upgrade mariadb without removing the default postfix config?

@freetirona,

MariaDB and Postfix have nothing in common, so it’s hard to believe that upgrading MariaDB would trigger uninstalling Postfix.

Can you show a screenshot of where is is being suggested?

1 Like

Hello,

It most probably doesn’t just remove Postfix but the whole Virtualmin stack. Also, this is not how you should upgrade MariaDB. You should use either yum update or better you swap command.

I tried to reinstall the server several times

Reinstall with Alma/Rocky 9. Do not reinstall with CentOS 7. Also, it will solve your initial problem (having later version of MariaDB version). CentOS 7 is sunsetting distro.

3 Likes

@Ilia,

Good catch, overlooked that part.

1 Like

The upgrade worked fine I restored my virtual servers and everything was working great the only problem is the Postfix, of course I have used yum update before doing things

I did same steps of this tutorial here How to Upgrade MariaDB 5.5 to MariaDB 10.1 on CentOS/RHEL 7 and Debian Systems

I reinstalled the server with ubuntu 22.04 which one comes with the MariaDB 10.6 but Im having problems with postfix here too, I can’t login to roundcube with the correct user and passwords, there is a wildcard ssl and everything is green on mxtools

However I have used centos 7 for years but I will give a try to AlmaLinux tomorow.

I found another topic with the same issue here Postfix Mail Server failed after upgrading MariaDB to 10.2 [#58362] | Virtualmin

Its a known issue.
Set this should fix it.

@freetirona,

First off, that thread is from 2018. Secondly, as noted by @Ilia and myself, upgrading MariaDB does NOT remove Postfix, they have no relation with one another, so there’s absolutely no reason why one would affect the other. I’ve upgraded MariaDB myself and have NEVER experienced it removing Postfix or other packages that are not related to it.

Secondly, you don’t “remove” packages to upgrade them, you upgrade them. So…

yum remove mariadb-server mariadb mariadb-libs

Is NOT the way you upgrade a package.

@stefan1959,

I’m not sure why you referenced this, as it doesn’t seem to have anything to do with this thread. The thread is about upgrading MariaDB allegedly causing Postfix to uninstall.

Your right it was not the thread. But I responding to this.

@stefan1959,

No problem, just try to keep things on topic.

So I can upgrade mariadb without removing the old version? Which is the best way to upgrade mariadb on centos 7 then?

I did my last installation with centos 7 again fresh install configured email settings and DKIM added back my wildcard and emails are working very nice I can send and receive via thunderbird

I wont upgrade mariadb just because I do not know how to fix it Im sure it will ask me to reinstall postfix after the upgrade and emails wont work like now any more, not sure if there are security issues with mariadb 5.5, if you can show a better guide about mariadb upgrade on centos 7 would be very helpful, thank you.

Why not install one of the recommended and more recent distros, such as Alma 9 or Rocky 9 or Debian 11 or Ubuntu 22.04? CentOS 7 should not be used for clean installs in 2023!

I tried Ubuntu 22.04 yesterday but the emails didn’t work as I wanted , I feel better with centos because I use it for years, never got issues. I would like to test AlmaLinux on a local server at home but for now I have to fix my email server because I have clients online and they have active conversations.

Allright now everything is working fine I would like to add the steps here if anyone wants to upgrade mariadb 5.5 to 10.11 on Centos 7 follow me below:

first get a backup if you have databases:
mysqldump -u root -ppassword --all-databases > /tmp/all-database.sql

Stop MariaDB server:
service mariadb stop

then run yum update

Add the repo:
nano /etc/yum.repos.d/MariaDB10.repo

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.11/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Save and exit.

The issue was in my previous command which I changed to
yum remove mariadb mariadb-server

This one does not effect to any other package but removes only the old mariadb server.

Now, clean the repository cache by running yum clean all and run the installation of v10.11
yum -y install MariaDB-server MariaDB-client

Start mariadb:
systemctl start mariadb

Automatically start after system boot via:
systemctl enable mariadb

And finally run the upgrade command
mysql_upgrade -u root -p

Check the version:
mysql -V

Thanks to everyone who replied and tried to help me have a nice day.

@freetirona,

The point @Ilia was making is that CentOS is in “maintenance” mode, and will be EOL Jun 30, 2024.

If you like CentOS which we get, the recommendation would be go with “AlmaLinux”, or “Rocky Linux” which are also based on RedHat and replace CentOS.

Starting a new system that is going to be EOL in a year, and has NO upgrade path is the thing @Ilia was pointing out.

2 Likes

Sure, I understand. I was reading some reviews and information about Alma Linux and looks interesting. in my server installation templates dropdown, I have 2 versions of Alma Linux 8 and 9, so which one is better for virtualmin?

I’m asking this question just because of this topic here: Almalinux-9-now-available - #5 by Ilia

Do you need awstats? (You probably don’t. But, if you do, don’t use Alma 9.)

In fact no I use only ClamAV and Spamassasin thats all.