How to Solve Error Message Problem: problem with installed package mysql-server when Installing MariaDB Server in Linux CentOS 8

Posted on

Introduction

This article will show how to solve an error message appear as in the title. The error message is ‘Problem: problem with installed package mysql-server-8.0.21’. The complete error appear in the following command execution upon the installation of MariaDB Server as follows :

[root@10 ~]# dnf install mariadb-server -y
CentOS Linux 8 - AppStream                                                              3.2 kB/s | 4.3 kB     00:01
CentOS Linux 8 - AppStream                                                              878 kB/s | 6.3 MB     00:07
CentOS Linux 8 - BaseOS                                                                 4.9 kB/s | 3.9 kB     00:00
CentOS Linux 8 - BaseOS                                                                 585 kB/s | 2.3 MB     00:03
CentOS Linux 8 - Extras                                                                 1.0 kB/s | 1.5 kB     00:01
Extra Packages for Enterprise Linux Modular 8 - x86_64                                  8.0 kB/s | 9.4 kB     00:01
Extra Packages for Enterprise Linux 8 - x86_64                                          9.0 kB/s | 7.0 kB     00:00
Extra Packages for Enterprise Linux 8 - x86_64                                          896 kB/s | 9.0 MB     00:10
Node.js Packages for Enterprise Linux 8 - x86_64                                        3.5 kB/s | 2.5 kB     00:00
Remi's Modular repository for Enterprise Linux 8 - x86_64                               1.3 kB/s | 3.5 kB     00:02
Safe Remi's RPM repository for Enterprise Linux 8 - x86_64                              4.0 kB/s | 3.0 kB     00:00
Error:
 Problem: problem with installed package mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64
  - package mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 conflicts with mariadb-server provided by mariadb-server-3:10.3.27-3.module_el8.3.0+599+c587b2e7.x86_64
  - package mariadb-server-3:10.3.27-3.module_el8.3.0+599+c587b2e7.x86_64 conflicts with mysql-server provided by mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64
  - conflicting requests
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[root@10 ~]#

So, the execution of the above installation process is stuck. Because there is already mysql-server package exist. It is triggering a conflict with the myaiadb-sever package. Actually, in order to solve this problem is very simple. Because there is a hint available in the command execution above. The hint is suggesting as follows :

(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

 

Solving the problem

As in the above output command execution, there is an alternatif for solving the problem. It suggests the following three actions :

1. First alternative is to execute the installation command with additional parameter ‘-allowerasing’. It is an alternative to replace the conflicting packages. In other words, removing MySQL package and replacing it with MariaDB package.

2. Second alternative is to execute the installation command with additional parameter ‘-skip-broken’ to skip uinstallable packages. This alternative is to evade or to skip the MariaDB package installation since it is conflicting with the current available MySQL package.

3. Third alternative is to execute the installation command with additional parameter ‘-nobest’. Actually, it is an execution by selecting the not only best candidate packages between MariaDB and MySQL packages.

Since the main goal is to replace the MySQL database server and replace it with MariaDB. The first alternative is the chosen one. But beware of the execution of the command. Please carefully backup first all of the data available in MySQL database server. It is urge to be cautios upon installing any packages primarily if it is a database server. There can be a potential loss of data removing an existing and running database.

Execution the Solution to Solve the Problem

So, the preferrred solution is the first alternative which is replacing the existence of MySQL package with MariaDB package. The following is the execution of the command :

[root@10 ~]# dnf --allowerasing install mariadb-server -y
Last metadata expiration check: 1:07:04 ago on Fri 19 Mar 2021 06:59:59 PM EDT.
Dependencies resolved.
...
Is this ok [y/N]: y
Downloading Packages:
...
Installed:
  mariadb-3:10.3.27-3.module_el8.3.0+599+c587b2e7.x86_64                            mariadb-backup-3:10.3.27-3.module_el8.3.0+599+c587b2e7.x86_64
  mariadb-common-3:10.3.27-3.module_el8.3.0+599+c587b2e7.x86_64                     mariadb-connector-c-3.1.11-2.el8_3.x86_64
  mariadb-errmsg-3:10.3.27-3.module_el8.3.0+599+c587b2e7.x86_64                     mariadb-gssapi-server-3:10.3.27-3.module_el8.3.0+599+c587b2e7.x86_64
  mariadb-server-3:10.3.27-3.module_el8.3.0+599+c587b2e7.x86_64                     mariadb-server-utils-3:10.3.27-3.module_el8.3.0+599+c587b2e7.x86_64
  perl-DBD-MySQL-4.046-3.module_el8.1.0+203+e45423dc.x86_64                         perl-DBI-1.641-3.module_el8.1.0+199+8f0a6bbd.x86_64
  psmisc-23.1-5.el8.x86_64
Complete!
[root@10 ~]#

The above command execution actually remove MySQL package and install MariaDB. But actually, there are far more simple step. Basically just remove the MySQL package after backup all the data and just install MariaDB package afterwards. The following is a command for checking the existence of the MySQL package :

[root@10 mysql]# systemctl start mysql
Failed to start mysql.service: Unit mysql.service not found.
[root@10 mysql]#

Starting mysql and it end failing actually prove that it does not exist anymore. Furthermore, listing the installed package also with ‘dnf’ cannot find the ‘mysql’ and ‘mysql-server’ accurately as follows :

[root@10 mysql]# dnf list installed | grep mysql
mysql-common.x86_64                         8.0.21-1.module_el8.2.0+493+63b41e36    @AppStream
mysql-errmsg.x86_64                         8.0.21-1.module_el8.2.0+493+63b41e36    @AppStream
php-mysqlnd.x86_64                          7.4.16-1.el8.remi                       @remi-modular
[root@10 mysql]#

On the other hand, listing the installed package with the name of ‘MariaDB’ will display the following result :

[root@10 mysql]# dnf list installed | grep mariadb
mariadb.x86_64                              3:10.3.27-3.module_el8.3.0+599+c587b2e7 @appstream
mariadb-backup.x86_64                       3:10.3.27-3.module_el8.3.0+599+c587b2e7 @appstream
mariadb-common.x86_64                       3:10.3.27-3.module_el8.3.0+599+c587b2e7 @appstream
mariadb-connector-c.x86_64                  3.1.11-2.el8_3                          @appstream
mariadb-connector-c-config.noarch           3.1.11-2.el8_3                          @appstream
mariadb-errmsg.x86_64                       3:10.3.27-3.module_el8.3.0+599+c587b2e7 @appstream
mariadb-gssapi-server.x86_64                3:10.3.27-3.module_el8.3.0+599+c587b2e7 @appstream
mariadb-server.x86_64                       3:10.3.27-3.module_el8.3.0+599+c587b2e7 @appstream
mariadb-server-utils.x86_64                 3:10.3.27-3.module_el8.3.0+599+c587b2e7 @appstream
[root@10 mysql]#

Basically, MariaDB package installation to replace MySQL package is a success. But after that, starting the service end in a failure. So, another article with the title of ‘How to Solve Error Message Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.’ in this link will show how to solve it.

One thought on “How to Solve Error Message Problem: problem with installed package mysql-server when Installing MariaDB Server in Linux CentOS 8

Leave a Reply