H
H
HellWalk2018-04-18 13:29:28
linux
HellWalk, 2018-04-18 13:29:28

How to resolve MySQL and MariaBD dependency conflict?

On a new project, MariaBD is used, I started installing it carelessly, and only in the process I noticed that the installer demolished MySQL for me. I exited the MairaBD installation.
I think okay, I'll install MariaBD on the docker, and restore MySQL on Ubuntu itself, but ... it wasn't there - it won't let me install MySQL, because MariaBD is supposedly installed.
Team

sudo apt-get -f install

Issues:
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.21-0ubuntu0.16.04.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error code 1
While processing the following packages encountered errors:
/var/cache/apt/archives/mysql-server-5.7_5.7.21-0ubuntu0.16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

When trying to uninstall MariaBD:
sudo apt-get remove mariadb-server

Reading package lists... Done
Building dependency tree
Reading status information... Done The package ' mariadb
-server' is not installed and therefore cannot be removed
You may want to use 'apt-get -f install' to fix these errors:
dependencies:
mysql-server : Depends: mysql-server-5.7 but it will not be installed
E: Unmet dependencies. Try "apt-get -f install" without a package name (or find another solution).

When trying to install back MariaBD:
sudo apt-get install mariadb-server

Reading package lists... Done
Building dependency tree
Reading status information... Done
You may want to use "apt-get -f install" to fix these errors:
Packages with unmet dependencies:
mariadb-server : Depends: mariadb-server-10.0 ( >= 10.0.34-0ubuntu0.16.04.1) but it won't install
mysql-server : Depends: mysql-server-5.7 but it won't install
E: Unmet dependencies. Try "apt-get -f install" without a package name (or find another solution).

Similarly for MySQL - neither install nor remove.
How to be?
PS
Other options:
sudo apt-get --purge remove mariadb

Reading package lists... Done
Building dependency tree
Reading status information... Done
E: Could not find package mariadb

sudo apt-get --purge remove mysql

Reading package lists... Done
Building dependency tree
Reading status information... Done
E: Could not find package mysql

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
zooks, 2018-04-18
@zooks

Replacing MySQL with MariaDB:

sudo apt remove --purge mysql-server mysql-client mysql-common
sudo apt autoremove
sudo apt install mariadb-server

W
Wexter, 2018-04-18
@Wexter

apt-get --purge remove mariadb*

F
Fixid, 2018-04-18
@Fixid

there are no mariadb and mysql packages, there is mariadb-server, mariadb-client etc
or use mariadb* or mariadb-server

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question