Here are the steps to uninstall MAAS (in this case 2.4) before a successful reinstallation on Ubuntu 18.04:
-
apt autoremove maas
-
apt-get purge maas*
-
apt autoremove postgresql*
-
apt-get purge postgresql*
Then proceed with normal installation (e.g. apt install maas).
Thanks to @ltrager on #maas Freenode