Attempting to purge mysql* with apt-get, unable to do so without interaction

Solution 1:

What worked for me was to set DEBIAN_FRONTEND=noninteractive environment variable:

sudo DEBIAN_FRONTEND=noninteractive apt-get remove -y --purge -qq <package-name>

-y to answer yes by default

--purge to delete all configuration files ( but seems that postsripts of dpkg will skip the removal of /var/lib/mysql folder so you will need to delete this manually.

-qq to tell the apt to be quiet at the highest level ( 2 ).