CentOS 7 Can't Uninstall MariaDB-Server : Error Comes Up

Glen Elkins asked:

I am trying to uninstall mariadb-server on Centos 7 and reinstall it, something went totally wrong with it and the server wouldn’t respond. This actually happened on another server recently but on this one due to things not responding something has gone wrong down the line and mariadb won’t uninstall.

Here is the error:

Remove  1 Package

Installed size: 465 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
error reading information on service mysql: No such file or directory
error: %preun(MariaDB-server-10.2.14-1.el7.centos.x86_64) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package MariaDB-server-10.2.14-1.el7.centos.x86_64
  Verifying  : MariaDB-server-10.2.14-1.el7.centos.x86_64                                                            1/1 

Failed:
  MariaDB-server.x86_64 0:10.2.14-1.el7.centos                                                                           

Complete!

And i can’t just run yum install mariadb-server because it says it’s already installed.

And i can’t just run yum install mariadb-server because it says it’s already installed.

Package 1:mariadb-server-5.5.60-1.el7_5.x86_64 is obsoleted by MariaDB-server-10.2.14-1.el7.centos.x86_64 which is already installed

And i also can’t start it:

systemctl start mariadb
Failed to start mariadb.service: Unit not found.

Something has completely messed up here, can’t uninstall, install or anything

My answer:


You should try to yum reinstall it:

yum reinstall MariaDB-server

This will redownload the RPM, reinstall it, and re-run any installation scripts.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.