Error trying to switch from MySQL to MariaDB in Ubuntu 20

Hi there,
I Just changed to Ubuntu and I am trying to switch from MySQL to MariaDB. This is what I get:

Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
mariadb-server : Depends: mariadb-server-10.3 (>= 1:10.3.25-0ubuntu0.20.04.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Does anyone know what is happening?
Thank you.

Operating system: Ubuntu
OS version: 20.04.1

You left off the important bit…what command you ran.

You’re probably missing a dependency or two in your apt-get install command. You’ll have to make sure all of the dependencies are satisfied explicitly, because dpkg won’t resolve dependencies to replace things being removed by conflicts.

Hi Joe,
Thanks for the reply. I have used the normal commands and not properly, indeed:
If someone needs help, here is what I’ve used and worked great:
Step 1: Update System

sudo apt update && sudo apt upgrade
sudo apt -y install software-properties-common

Step 2 Import MariaDB gpg key:

sudo apt-key adv --fetch-keys ''

Step 3: Add MariaDB APT repository

sudo add-apt-repository 'deb [arch=amd64] focal main'

Step 4: Install MariaDB Server on 20.04 Linux

sudo apt update
sudo apt install mariadb-server mariadb-client

Step 5: Secure MariaDB Server on 20.04 Linux

sudo mysql_secure_installation 

1 Like

Can you upgrade from MySQL to MariaDB? I have a running system and one of my users asked me today if we could migrate to MariaDB…

Are you sure you actually have MySQL? Most current distros use mariadb by default (Virtualmin uses “MySQL” to generically refer to both).

It worked for me pretty well.

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