Para remover o MySQL por completo:
sudo apt remove --purge mysql-server
sudo apt purge mysql-server
sudo apt autoremove
sudo apt autoclean
sudo apt remove dbconfig-mysql
sudo systemctl stop mysql sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
sudo rm -rf /etc/mysql /var/lib/mysql /var/log/mysql sudo apt autoremove
sudo apt autoclean
Para iniciar a instalação do MariaDB faça:
$ sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ $ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
sudo dpkg --configure mariadb-server
$ sudo systemctl stop apparmor.service $ sudo update-rc.d -f apparmor remove $ sudo apt-get remove --purge mysql-server mysql-client mysql-common $ sudo apt-get autoremove $ sudo apt-get autoclean $ sudo apt-get install mariadb-server $ sudo systemctl start apparmor.service $ sudo update-rc.d apparmor defaults
Fontes:
https://www.digitalocean.com/community/tutorials/how-to-install-mariadb-on-ubuntu-20-04-pt
https://www.digitalocean.com/community/questions/completely-uninstall-mysql-server
https://mariadb.com/kb/en/the-community-mariadb-troubles-only-running-after-reboot-times-out-when-try/