I am facing this on ubuntu 18.04. I added "set -x" to the beginning of /var/lib/dpkg/info/postgresql- common.postinst and did the dpkg --configure -a again, as suggested by Christoph. The output is given below, I can't make out anything from that:
$ sudo dpkg --configure -a Setting up postgresql-common (190) ... + set -e + [ postgresql-common ] + . /usr/share/debconf/confmodule + [ ! ] + PERL_DL_NONLAZY=1 + export PERL_DL_NONLAZY + [ ] + exec /usr/share/debconf/frontend /var/lib/dpkg/info/postgresql-common.postinst configure + set -e + [ postgresql-common ] + . /usr/share/debconf/confmodule + [ ! 1 ] + [ -z ] + exec + [ ] + exec + DEBCONF_REDIR=1 + export DEBCONF_REDIR + SSL_ROOT=/etc/postgresql-common/root.crt + [ configure = configure ] + [ postgresql-common ] + quiet=--quiet + getent passwd postgres + getent group postgres + + id -Gn postgres grep -qw postgres + id -u postgres + [ 126 -eq 0 ] + id -g postgres + [ 129 -eq 0 ] + mkdir -p /var/lib/postgresql + su -s /bin/sh postgres -c test -O /var/lib/postgresql && test -G /var/lib/postgresql -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1528822 Title: Installation hangs at password prompt To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/postgresql-common/+bug/1528822/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs