Same problem, found fix at https://omgdebugging.com/2016/09/04/fixing-hung-up-mysql-installation-on-ubuntu-16-04-lts/. I ran (as root) (sleep 200; killall mysqld)& then immediately apt-get install -y mysql-server mysql-client in my provisioning script.


After purging, check your /var/lib/mysql directory if it contains any files, and move those to other place or delete before trying to re-install.