If your system is using dpkg and apt (debian, ubuntu, etc), try running the following commands in that order you can remove phpMyAdmin on Ubuntu 18.04

sudo apt-get -f install
sudo dpkg -P phpmyadmin  
sudo rm -vf /etc/apache2/conf.d/phpmyadmin.conf
sudo rm -vfR /usr/share/phpmyadmin
sudo service apache2 restart

This will ask you a few questions in order to  remove phpMyAdmin on Ubuntu 18.04