Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Package postgresql-9.6 is not configured yet

1,954 views
Skip to first unread message

Marco DE BOOIJ

unread,
Aug 23, 2017, 10:20:06 AM8/23/17
to
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
postg...@9.6-main.service loaded active running PostgreSQL Cluster
9.6-main
system-postgresql.slice loaded active active system-postgresql.slice
root:~#

Cindy-Sue Causey

unread,
Aug 23, 2017, 11:30:06 AM8/23/17
to
That "4 not fully installed or removed." is one part of whatever is
going on. I've had that happen if I CTRL+C cancel a command before
it's finished, but there could be any number of other reasons why it
happens, I'm sure.

There's a command that you can run, but I forget what it is that
*usually* cleans up house for me. ONCE in a while it's a bigger battle
than just that, though.

A search attempt on the Net landed me the possibility that I'm thinking of:

dpkg --configure -a

I took that back to "man dpkg" which additionally references "dpkg-reconfigure".

PLEASE do *NOT* try these without researching what they do. I *have*,
yes, had success, and those sound familiar of part of that success.
Maybe someone else has insight based on those *if* they're appropriate
to consider as one option in your instance..

Good luck with your situation..

Cindy :)
--
Cindy-Sue Causey
Talking Rock, Pickens County, Georgia, USA

* runs with duct tape *

Greg Wooledge

unread,
Aug 23, 2017, 1:20:05 PM8/23/17
to
On Wed, Aug 23, 2017 at 11:28:14AM -0400, Cindy-Sue Causey wrote:
> On 8/23/17, Marco DE BOOIJ <marco.m...@debooy.eu> wrote:
> > 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

> A search attempt on the Net landed me the possibility that I'm thinking of:
>
> dpkg --configure -a

Yes, that's probably the first thing to try. But if that fails (again),
then the problem appears to be in the postinst script itself, or more
precisely whatever command the postinst script executes.

I don't have a stretch box with postgresql-9.6 installed at the moment,
but looking at a jessie box with -9.4, the postinst is simply this:

=============================================================
#!/bin/sh

set -e

VERSION=9.4

if [ "$1" = configure ]; then
. /usr/share/postgresql-common/maintscripts-functions

configure_version $VERSION "$2"
fi
=============================================================

Following the trail, the configure_version function is defined in
/usr/share/postgresql-common/maintscripts-functions and looks like:

=============================================================
configure_version() {
VERSION="$1"

# Create a main cluster for given version ($1) if no cluster already exists
# for that version and we are installing from scratch.
[ "$VERSION" ] || { echo "Error: configure_version: need version parameter" >&2; exit 1; }
if [ ! -d "/etc/postgresql/$VERSION" ] || [ -z "$(ls /etc/postgresql/$VERSION)" ] || \
[ -z "$(ls /etc/postgresql/$VERSION/*/postgresql.conf 2>/dev/null)" ]; then
# skip creating the main cluster when this is not the first install, or
# when explicitely disabled ($create is 1/0/"")
create=$(perl -I/usr/share/postgresql-common -mPgCommon -e 'print PgCommon::config_bool(PgCommon::get_conf_value 0, 0, "createcluster.conf", "create_main_cluster")')
if [ -z "$2" ] && [ "$create" != "0" ]; then
set_system_locale
/usr/bin/pg_createcluster -u postgres $VERSION main ||
echo "Error: could not create default cluster. Please create it manually with

pg_createcluster $VERSION main --start

or a similar command (see 'man pg_createcluster')." >&2
fi
fi

_link_manpages "$VERSION" postmaster.1.gz "postgresql-$1" "postgresql-contrib-$1"

if [ -x /etc/init.d/postgresql ] && [ ! -x /etc/init.d/postgresql-$VERSION ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d postgresql start $VERSION || exit $?
else
/etc/init.d/postgresql start $VERSION || exit $?
fi

fi
}
=============================================================

Of course the stretch version may be different. Assuming Marco is
even running stretch; he didn't say.

So, to figure out what's breaking, what I would do is put "set -x" at the
start of the configure_version function, and "set +x" at the end of it.
Then try dpkg --configure -a once again. That should give you a shell
trace of the commands being executed in that function, so you can see
which one breaks.

Assuming Marco's versions of these scripts look basically like jessie's.

Marco DE BOOIJ

unread,
Aug 23, 2017, 4:40:07 PM8/23/17
to
The dpkg --configure -a gives the same result. I will look into the
scripts that you included and try them since I am on jessie. I will go
to stretch as soon as this problem is solved. Do not think that it is
not a good idea to do this now.

BTW Postgresql 9.6 is running well.

Marco


Op 23-08-17 om 19:13 schreef Greg Wooledge:

Marco DE BOOIJ

unread,
Aug 27, 2017, 4:50:06 AM8/27/17
to
The script stops at: invoke-rc.d postgresql start $VERSION #
systemd: argument ignored, starts all versions

This is the last step in the configure_version() function. Is this
really necessary when you use systemctl? Can I comment it safely just to
finish the configuration?

The server has already started a few times so I am sure that postgresql
restarts. Here is information on the postgresql service:

root:~# systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled)
Active: active (exited) since Fri 2017-08-25 08:08:22 CEST; 2 days ago
Main PID: 1269 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/postgresql.service

Aug 25 08:08:22 jessie systemd[1]: Started PostgreSQL RDBMS.
root:~#


Op 23-08-17 om 19:13 schreef Greg Wooledge:

Marco DE BOOIJ

unread,
Sep 29, 2017, 3:20:06 PM9/29/17
to
Tried to solve it by looking at the configuration script but with no
success. I gave up and, after securing my database and configuration
file, I did an apt-get purge of all postgresql. Then I re-installed it
again.

Unfortunately the purge had left the /var/lib/postgres/9.6 and this
prevented the correct installation (/etc/postgresql/9.6 was missing). An
other purge and rm -rf /var/lib/postgres/9.6. Now the install went
correct. After copying back the config files and database files I was
back in business.

Problem CLOSED.

Op 27-08-17 om 10:46 schreef Marco DE BOOIJ:
0 new messages