MariaDB 10.1 and Ubuntu 16.04: Unable to set password for the MariaDB "root" user

When trying to install MariaDB 10.1 in an Ubuntu 16.04 Server with previous MySQL installed, even purging MySQL with sudo apt-get purge mysql*, I get this error message and the install process fail.