[Pkg-postgresql-public] Bug#874427: /usr/bin/pg_config in multiple packages

Bryan Henderson bryanh at giraffe-data.com
Wed Sep 6 16:20:38 UTC 2017


>that's not a bug, the /usr/bin/pg_config from libpq-dev is moved aside
>by postgresql-common's preinst script via dpkg-divert:

Thanks; I figured I was missing something like that.

>Does "apt-get install --reinstall postgresql-common" fix things?

apt-get install --reinstall refuses to run because of the broken dependency
(which I can't fix until I get this fixed), so I just did the
'dpkg --install' manually and that fixed it.


If you want a post mortem:

Before I started, there is no diversion:

  root at rhino:/tmp# dpkg --search /usr/bin/pg_config
  postgresql-common, libpq-dev: /usr/bin/pg_config

The first reinstallation says it's ignoring the request to rename:

  root at rhino:/tmp# dpkg --install postgresql-common_165+deb8u2_all.deb
  (Reading database ... 86016 files and directories currently installed.)
  Preparing to unpack postgresql-common_165+deb8u2_all.deb ...
  Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by post\
  gresql-common'
  Ignoring request to rename file '/usr/bin/pg_config' owned by diverting package\
   'postgresql-common'
  Unpacking postgresql-common (165+deb8u2) over (165+deb8u2) ...
  Setting up postgresql-common (165+deb8u2) ...
  Processing triggers for systemd (215-17+deb8u7) ...
  Processing triggers for man-db (2.7.0.2-5) ...

And it did:

  root at rhino:/tmp# ls /usr/bin/pg_config*
  /usr/bin/pg_config

A second reinstallation is different:

  root at rhino:/tmp# dpkg --install postgresql-common_165+deb8u2_all.deb
  (Reading database ... 86017 files and directories currently installed.)
  Preparing to unpack postgresql-common_165+deb8u2_all.deb ...
  Leaving 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by pos\
  tgresql-common'
  Unpacking postgresql-common (165+deb8u2) over (165+deb8u2) ...
  Setting up postgresql-common (165+deb8u2) ...
  Processing triggers for systemd (215-17+deb8u7) ...
  Processing triggers for man-db (2.7.0.2-5) ...

And now it's fixed:

  root at rhino:/tmp# dpkg --search /usr/bin/pg_config
  diversion by postgresql-common from: /usr/bin/pg_config
  diversion by postgresql-common to: /usr/bin/pg_config.libpq-dev
  postgresql-common, libpq-dev: /usr/bin/pg_config

  root at rhino:/tmp# ls /usr/bin/pg_config*
  /usr/bin/pg_config  /usr/bin/pg_config.libpq-dev

The only thing I can think of that I did out of the ordinary to cause this is
that I don't normally update my system by installing all the new packages at
once; I install them a few at a time to limit the damage if something breaks.
So I may have updated Postgres packages in a different order than is usual.

Anyway, I'm glad to know how this diversion works so if this happens again, I
can repair it.

-- 
Bryan Henderson                                   San Jose, California



More information about the Pkg-postgresql-public mailing list