Problem: Upgrade Fails With An Error Related To PostgreSQL

Problem: Upgrade Fails With An Error Related To PostgreSQL

You attempted to perform an upgrade which fails. In /var/log/univention/updater.log you will notice the following errors:

Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Trying to fix the package database results the following error:

root@ucs:~# dpkg --configure -a
postgresql-common (165+deb8u2A~ wird eingerichtet ...
[....] Starting PostgreSQL 9.1 database server: main[....] The PostgreSQL server failed to start. Please check the log output: 2019-05-10 17:12:39 CEST
LOG: could not open configuration file "/etc/p[FAILesql/9.1/main/pg_hba.conf":
No such file or directory 2019-05-10 17:12:39 CEST FATAL: could not load pg_hba.conf ... failed!


dpkg: Fehler beim Bearbeiten des Paketes postgresql-server-dev-9.1 (--configure):
Abhängigkeitsprobleme - verbleibt unkonfiguriert
Fehler traten auf beim Bearbeiten von:


This might be a left-over from an earlier app which has been removed a while ago.
Make sure there are no databases configured in PostgreSQL:

root@ucs:~# ls -alh /etc/postgresql
insgesamt 20K
drwxr-xr-x   3 root     root     4,0K Mai  4 14:30 .
drwxr-xr-x 169 root     root      12K Mai 13 11:08 ..
drwxr-xr-x   3 postgres postgres 4,0K Mär  2  2016 9.1

Check the content in the directory /etc/postgresql/9.1 if it is currently in use (ie by checking the file last access dates). In case you are sure no app is using a PostgreSQL database you can remove the packages:

apt remove postgresql-common
apt remove postgresql-9.1
apt remove postgresql-server-dev-9.1

The restart the upgrade from console:
univention-upgrade --ignoreterm --ignoressh --updateto=4.2-0