I recently did an apt-get upgrade and it did not want to install a newer version of postgresql-contrib-9.6. I searched the web and tried to reinstall it (with remove and install because I did not want to loose my database) but did did not solve it. Before I will try to purge and install it I want to ask if there is an 'easier' way. I also tried dpkg --configure postgresql-9.6 but this fails:

root:~# dpkg --configure postgresql-9.6
Setting up postgresql-9.6 (9.6.4-1.pgdg80+1) ...
dpkg: error processing package postgresql-9.6 (--configure):
subprocess installed post-installation script returned error exit status 102
Errors were encountered while processing:
 postgresql-9.6
root:~#

I checked the logfiles dpkg.log and alternatives.log but I saw no clear information.

dpkg.log:

2017-08-23 15:45:28 startup packages configure
2017-08-23 15:45:28 configure postgresql-9.6:amd64 9.6.4-1.pgdg80+1 <none>
2017-08-23 15:45:28 status half-configured postgresql-9.6:amd64 9.6.4-1.pgdg80+1

alternatives.log showed only update-alternatives 2017-08-23 15:45:29: run with --install with all files for *man*.

Recently I removed version 9.5. Perhaps this is the reason for the problem. Some information on the installation:

root:~# dpkg-query -l | grep postgres
ii  pgdg-keyring                          2017.1
iU  postgresql                            9.6+184.pgdg80+1
iF  postgresql-9.6                        9.6.4-1.pgdg80+1
ii  postgresql-client-9.6                 9.6.4-1.pgdg80+1
ii  postgresql-client-common              184.pgdg80+1
ii  postgresql-common                     184.pgdg80+1
iU  postgresql-contrib                    9.6+184.pgdg80+1
iU  postgresql-contrib-9.6                9.6.4-1.pgdg80+1
root:~# apt-get install postgresql postgresql-contrib
Reading package lists... Done
Building dependency tree
Reading state information... Done
postgresql is already the newest version.
postgresql-contrib is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up postgresql-9.6 (9.6.4-1.pgdg80+1) ...
dpkg: error processing package postgresql-9.6 (--configure):
subprocess installed post-installation script returned error exit status 102
dpkg: dependency problems prevent configuration of postgresql:
 postgresql depends on postgresql-9.6; however:
  Package postgresql-9.6 is not configured yet.

dpkg: error processing package postgresql (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib-9.6:
postgresql-contrib-9.6 depends on postgresql-9.6 (= 9.6.4-1.pgdg80+1); however:
  Package postgresql-9.6 is not configured yet.

dpkg: error processing package postgresql-contrib-9.6 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib:
 postgresql-contrib depends on postgresql-contrib-9.6; however:
  Package postgresql-contrib-9.6 is not configured yet.

dpkg: error processing package postgresql-contrib (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 postgresql-9.6
 postgresql
 postgresql-contrib-9.6
 postgresql-contrib
E: Sub-process /usr/bin/dpkg returned an error code (1)
root:~# cat /etc/apt/sources.list.d/pgdg.list
deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main
root:~# systemctl | grep postgres
srv-postgres.mount          loaded active mounted   /srv/postgres
postgresql.service          loaded active exited    PostgreSQL RDBMS
postgresql@9.6-main.service loaded active running PostgreSQL Cluster 9.6-main
system-postgresql.slice     loaded active active system-postgresql.slice
root:~#

Reply via email to