the problem sounds very similar to Working with elasticsearch-keystore
it's getting to /var/lib/dpkg/info/elasticsearch.postinst
and hanging at the elasticsearch-keystore create
in this seciton of that file:
# the equivalent code for rpm is in posttrans
if [ "$PACKAGE" = "deb" ]; then
if [ ! -f "${ES_PATH_CONF}"/elasticsearch.keystore ]; then
/usr/share/elasticsearch/bin/elasticsearch-keystore create
chown root:elasticsearch "${ES_PATH_CONF}"/elasticsearch.keystore
chmod 660 "${ES_PATH_CONF}"/elasticsearch.keystore
md5sum "${ES_PATH_CONF}"/elasticsearch.keystore > "${ES_PATH_CONF}"/.elasticsearch.keystore.initial_md5sum
else
if /usr/share/elasticsearch/bin/elasticsearch-keystore has-passwd --silent ; then
echo "### Warning: unable to upgrade encrypted keystore" 1>&2
echo " Please run elasticsearch-keystore upgrade and enter password" 1>&2
else
/usr/share/elasticsearch/bin/elasticsearch-keystore upgrade
fi
fi
fi
exit 0
# Built for packages-7.13.2 (deb)
ubuntu@es-master1:~$