To install phpmyadmin in a script (automatic installation) without installing / configuring any web server or with the phpmyadmin database configured using dbconfig-common, you need to configure the following parameters before installing the package
phpmyadmin phpmyadmin/internal/skip-preseed boolean true phpmyadmin phpmyadmin/reconfigure-webserver multiselect phpmyadmin phpmyadmin/dbconfig-install boolean false
Without phpmyadmin phpmyadmin/internal/skip-preseed boolean true it will start setting up the database using dbconfig-common (regardless of how phpmyadmin phpmyadmin/dbconfig-install installed). For me it was something that was missing, and I did not find on Google. The rest are obvious.
You can install them like this:
debconf-set-selections <<< "phpmyadmin phpmyadmin/internal/skip-preseed boolean true" debconf-set-selections <<< "phpmyadmin phpmyadmin/reconfigure-webserver multiselect" debconf-set-selections <<< "phpmyadmin phpmyadmin/dbconfig-install boolean false"
Or if this does not work:
echo "phpmyadmin phpmyadmin/internal/skip-preseed boolean true" | debconf-set-selections echo "phpmyadmin phpmyadmin/reconfigure-webserver multiselect" | debconf-set-selections echo "phpmyadmin phpmyadmin/dbconfig-install boolean false" | debconf-set-selections
Then run apt-get -y install phpmyadmin .
source share