first , purge main package name :
sudo apt-get purge mariadb-server
then
sudo apt autoremove
then run this command to find all packages that may are related to the package which you want to purge :
sudo dpkg -l | grep mariadb
after that purg services that are returned one by one