Closed phillxnet closed 1 year ago
For this we need the 'alternatives' command line that selects, non interactively, our postgresql13 requirement.
Using an aging system (Leap 15.3) with already 2 alternatives we have:
update-alternatives --set postgresql /usr/lib/postgresql13
which was the default anyway:
rleap15-3:~ # update-alternatives --display postgresql
postgresql - manual mode
link best version is /usr/lib/postgresql13
link currently points to /usr/lib/postgresql13
link postgresql is /usr/lib/postgresql
slave clusterdb is /usr/bin/clusterdb
slave createdb is /usr/bin/createdb
slave createuser is /usr/bin/createuser
slave dropdb is /usr/bin/dropdb
slave dropuser is /usr/bin/dropuser
slave ecpg is /usr/bin/ecpg
slave initdb is /usr/bin/initdb
slave pg_basebackup is /usr/bin/pg_basebackup
slave pg_checksums is /usr/bin/pg_checksums
slave pg_config is /usr/bin/pg_config
slave pg_controldata is /usr/bin/pg_controldata
slave pg_ctl is /usr/bin/pg_ctl
slave pg_dump is /usr/bin/pg_dump
slave pg_dumpall is /usr/bin/pg_dumpall
slave pg_isready is /usr/bin/pg_isready
slave pg_receivewal is /usr/bin/pg_receivewal
slave pg_recvlogical is /usr/bin/pg_recvlogical
slave pg_resetwal is /usr/bin/pg_resetwal
slave pg_restore is /usr/bin/pg_restore
slave pg_rewind is /usr/bin/pg_rewind
slave pg_verifybackup is /usr/bin/pg_verifybackup
slave pg_waldump is /usr/bin/pg_waldump
slave postgres is /usr/bin/postgres
slave postmaster is /usr/bin/postmaster
slave psql is /usr/bin/psql
slave reindexdb is /usr/bin/reindexdb
slave vacuumdb is /usr/bin/vacuumdb
/usr/lib/postgresql10 - priority 100
slave clusterdb: /usr/lib/postgresql10/bin/clusterdb
slave createdb: /usr/lib/postgresql10/bin/createdb
slave createuser: /usr/lib/postgresql10/bin/createuser
slave dropdb: /usr/lib/postgresql10/bin/dropdb
slave dropuser: /usr/lib/postgresql10/bin/dropuser
slave initdb: /usr/lib/postgresql10/bin/initdb
slave pg_basebackup: /usr/lib/postgresql10/bin/pg_basebackup
slave pg_controldata: /usr/lib/postgresql10/bin/pg_controldata
slave pg_ctl: /usr/lib/postgresql10/bin/pg_ctl
slave pg_dump: /usr/lib/postgresql10/bin/pg_dump
slave pg_dumpall: /usr/lib/postgresql10/bin/pg_dumpall
slave pg_isready: /usr/lib/postgresql10/bin/pg_isready
slave pg_receivewal: /usr/lib/postgresql10/bin/pg_receivewal
slave pg_recvlogical: /usr/lib/postgresql10/bin/pg_recvlogical
slave pg_resetwal: /usr/lib/postgresql10/bin/pg_resetwal
slave pg_restore: /usr/lib/postgresql10/bin/pg_restore
slave pg_rewind: /usr/lib/postgresql10/bin/pg_rewind
slave pg_waldump: /usr/lib/postgresql10/bin/pg_waldump
slave postgres: /usr/lib/postgresql10/bin/postgres
slave postmaster: /usr/lib/postgresql10/bin/postmaster
slave psql: /usr/lib/postgresql10/bin/psql
slave reindexdb: /usr/lib/postgresql10/bin/reindexdb
slave vacuumdb: /usr/lib/postgresql10/bin/vacuumdb
/usr/lib/postgresql13 - priority 130
slave clusterdb: /usr/lib/postgresql13/bin/clusterdb
slave createdb: /usr/lib/postgresql13/bin/createdb
slave createuser: /usr/lib/postgresql13/bin/createuser
slave dropdb: /usr/lib/postgresql13/bin/dropdb
slave dropuser: /usr/lib/postgresql13/bin/dropuser
slave ecpg: /usr/lib/postgresql13/bin/ecpg
slave initdb: /usr/lib/postgresql13/bin/initdb
slave pg_basebackup: /usr/lib/postgresql13/bin/pg_basebackup
slave pg_checksums: /usr/lib/postgresql13/bin/pg_checksums
slave pg_config: /usr/lib/postgresql13/bin/pg_config
slave pg_controldata: /usr/lib/postgresql13/bin/pg_controldata
slave pg_ctl: /usr/lib/postgresql13/bin/pg_ctl
slave pg_dump: /usr/lib/postgresql13/bin/pg_dump
slave pg_dumpall: /usr/lib/postgresql13/bin/pg_dumpall
slave pg_isready: /usr/lib/postgresql13/bin/pg_isready
slave pg_receivewal: /usr/lib/postgresql13/bin/pg_receivewal
slave pg_recvlogical: /usr/lib/postgresql13/bin/pg_recvlogical
slave pg_resetwal: /usr/lib/postgresql13/bin/pg_resetwal
slave pg_restore: /usr/lib/postgresql13/bin/pg_restore
slave pg_rewind: /usr/lib/postgresql13/bin/pg_rewind
slave pg_verifybackup: /usr/lib/postgresql13/bin/pg_verifybackup
slave pg_waldump: /usr/lib/postgresql13/bin/pg_waldump
slave postgres: /usr/lib/postgresql13/bin/postgres
slave postmaster: /usr/lib/postgresql13/bin/postmaster
slave psql: /usr/lib/postgresql13/bin/psql
slave reindexdb: /usr/lib/postgresql13/bin/reindexdb
slave vacuumdb: /usr/lib/postgresql13/bin/vacuumdb
rleap15-3:~ # pg_config --version
PostgreSQL 13.9
rleap15-3:~ # ls -la /etc/alternatives/pg_config
lrwxrwxrwx 1 root root 35 Jul 25 20:27 /etc/alternatives/pg_config -> /usr/lib/postgresql13/bin/pg_config
rleap15-3:~ # update-alternatives --set postgresql /usr/lib/postgresql10
update-alternatives: using /usr/lib/postgresql10 to provide /usr/lib/postgresql (postgresql) in manual mode
rleap15-3:~ # which pg_config
which: no pg_config in (/sbin:/usr/sbin:/usr/local/sbin:/root/.local/bin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin)
rleap15-3:~ # pg_config --version
-bash: /usr/bin/pg_config: No such file or directory
rleap15-3:~ # ls -la /etc/alternatives/pg_config
ls: cannot access '/etc/alternatives/pg_config': No such file or directory
With the following slave settings to the master postgresql10 binary index:
rleap15-3:~ # update-alternatives --display postgresql
postgresql - manual mode
link best version is /usr/lib/postgresql13
link currently points to /usr/lib/postgresql10
link postgresql is /usr/lib/postgresql
slave clusterdb is /usr/bin/clusterdb
slave createdb is /usr/bin/createdb
slave createuser is /usr/bin/createuser
slave dropdb is /usr/bin/dropdb
slave dropuser is /usr/bin/dropuser
slave ecpg is /usr/bin/ecpg
slave initdb is /usr/bin/initdb
slave pg_basebackup is /usr/bin/pg_basebackup
slave pg_checksums is /usr/bin/pg_checksums
slave pg_config is /usr/bin/pg_config
slave pg_controldata is /usr/bin/pg_controldata
slave pg_ctl is /usr/bin/pg_ctl
slave pg_dump is /usr/bin/pg_dump
slave pg_dumpall is /usr/bin/pg_dumpall
slave pg_isready is /usr/bin/pg_isready
slave pg_receivewal is /usr/bin/pg_receivewal
slave pg_recvlogical is /usr/bin/pg_recvlogical
slave pg_resetwal is /usr/bin/pg_resetwal
slave pg_restore is /usr/bin/pg_restore
slave pg_rewind is /usr/bin/pg_rewind
slave pg_verifybackup is /usr/bin/pg_verifybackup
slave pg_waldump is /usr/bin/pg_waldump
slave postgres is /usr/bin/postgres
slave postmaster is /usr/bin/postmaster
slave psql is /usr/bin/psql
slave reindexdb is /usr/bin/reindexdb
slave vacuumdb is /usr/bin/vacuumdb
/usr/lib/postgresql10 - priority 100
slave clusterdb: /usr/lib/postgresql10/bin/clusterdb
slave createdb: /usr/lib/postgresql10/bin/createdb
slave createuser: /usr/lib/postgresql10/bin/createuser
slave dropdb: /usr/lib/postgresql10/bin/dropdb
slave dropuser: /usr/lib/postgresql10/bin/dropuser
slave initdb: /usr/lib/postgresql10/bin/initdb
slave pg_basebackup: /usr/lib/postgresql10/bin/pg_basebackup
slave pg_controldata: /usr/lib/postgresql10/bin/pg_controldata
slave pg_ctl: /usr/lib/postgresql10/bin/pg_ctl
slave pg_dump: /usr/lib/postgresql10/bin/pg_dump
slave pg_dumpall: /usr/lib/postgresql10/bin/pg_dumpall
slave pg_isready: /usr/lib/postgresql10/bin/pg_isready
slave pg_receivewal: /usr/lib/postgresql10/bin/pg_receivewal
slave pg_recvlogical: /usr/lib/postgresql10/bin/pg_recvlogical
slave pg_resetwal: /usr/lib/postgresql10/bin/pg_resetwal
slave pg_restore: /usr/lib/postgresql10/bin/pg_restore
slave pg_rewind: /usr/lib/postgresql10/bin/pg_rewind
slave pg_waldump: /usr/lib/postgresql10/bin/pg_waldump
slave postgres: /usr/lib/postgresql10/bin/postgres
slave postmaster: /usr/lib/postgresql10/bin/postmaster
slave psql: /usr/lib/postgresql10/bin/psql
slave reindexdb: /usr/lib/postgresql10/bin/reindexdb
slave vacuumdb: /usr/lib/postgresql10/bin/vacuumdb
/usr/lib/postgresql13 - priority 130
slave clusterdb: /usr/lib/postgresql13/bin/clusterdb
slave createdb: /usr/lib/postgresql13/bin/createdb
slave createuser: /usr/lib/postgresql13/bin/createuser
slave dropdb: /usr/lib/postgresql13/bin/dropdb
slave dropuser: /usr/lib/postgresql13/bin/dropuser
slave ecpg: /usr/lib/postgresql13/bin/ecpg
slave initdb: /usr/lib/postgresql13/bin/initdb
slave pg_basebackup: /usr/lib/postgresql13/bin/pg_basebackup
slave pg_checksums: /usr/lib/postgresql13/bin/pg_checksums
slave pg_config: /usr/lib/postgresql13/bin/pg_config
slave pg_controldata: /usr/lib/postgresql13/bin/pg_controldata
slave pg_ctl: /usr/lib/postgresql13/bin/pg_ctl
slave pg_dump: /usr/lib/postgresql13/bin/pg_dump
slave pg_dumpall: /usr/lib/postgresql13/bin/pg_dumpall
slave pg_isready: /usr/lib/postgresql13/bin/pg_isready
slave pg_receivewal: /usr/lib/postgresql13/bin/pg_receivewal
slave pg_recvlogical: /usr/lib/postgresql13/bin/pg_recvlogical
slave pg_resetwal: /usr/lib/postgresql13/bin/pg_resetwal
slave pg_restore: /usr/lib/postgresql13/bin/pg_restore
slave pg_rewind: /usr/lib/postgresql13/bin/pg_rewind
slave pg_verifybackup: /usr/lib/postgresql13/bin/pg_verifybackup
slave pg_waldump: /usr/lib/postgresql13/bin/pg_waldump
slave postgres: /usr/lib/postgresql13/bin/postgres
slave postmaster: /usr/lib/postgresql13/bin/postmaster
slave psql: /usr/lib/postgresql13/bin/psql
slave reindexdb: /usr/lib/postgresql13/bin/reindexdb
slave vacuumdb: /usr/lib/postgresql13/bin/vacuumdb
So in the above we see the equivalent of pg_config not being available as our example systems '10' packages do not provide it, at least under the configuration of alternatives in the 'postgresql10' setting.
Our supported and previously working (with pg_config) package set:
rleap15-3:~ # update-alternatives --set postgresql /usr/lib/postgresql13
update-alternatives: using /usr/lib/postgresql13 to provide /usr/lib/postgresql (postgresql) in manual mode
rleap15-3:~ # update-alternatives --display postgresql
postgresql - manual mode
link best version is /usr/lib/postgresql13
link currently points to /usr/lib/postgresql13
link postgresql is /usr/lib/postgresql
slave clusterdb is /usr/bin/clusterdb
slave createdb is /usr/bin/createdb
slave createuser is /usr/bin/createuser
slave dropdb is /usr/bin/dropdb
slave dropuser is /usr/bin/dropuser
slave ecpg is /usr/bin/ecpg
slave initdb is /usr/bin/initdb
slave pg_basebackup is /usr/bin/pg_basebackup
slave pg_checksums is /usr/bin/pg_checksums
slave pg_config is /usr/bin/pg_config
slave pg_controldata is /usr/bin/pg_controldata
slave pg_ctl is /usr/bin/pg_ctl
slave pg_dump is /usr/bin/pg_dump
slave pg_dumpall is /usr/bin/pg_dumpall
slave pg_isready is /usr/bin/pg_isready
slave pg_receivewal is /usr/bin/pg_receivewal
slave pg_recvlogical is /usr/bin/pg_recvlogical
slave pg_resetwal is /usr/bin/pg_resetwal
slave pg_restore is /usr/bin/pg_restore
slave pg_rewind is /usr/bin/pg_rewind
slave pg_verifybackup is /usr/bin/pg_verifybackup
slave pg_waldump is /usr/bin/pg_waldump
slave postgres is /usr/bin/postgres
slave postmaster is /usr/bin/postmaster
slave psql is /usr/bin/psql
slave reindexdb is /usr/bin/reindexdb
slave vacuumdb is /usr/bin/vacuumdb
/usr/lib/postgresql10 - priority 100
slave clusterdb: /usr/lib/postgresql10/bin/clusterdb
slave createdb: /usr/lib/postgresql10/bin/createdb
slave createuser: /usr/lib/postgresql10/bin/createuser
slave dropdb: /usr/lib/postgresql10/bin/dropdb
slave dropuser: /usr/lib/postgresql10/bin/dropuser
slave initdb: /usr/lib/postgresql10/bin/initdb
slave pg_basebackup: /usr/lib/postgresql10/bin/pg_basebackup
slave pg_controldata: /usr/lib/postgresql10/bin/pg_controldata
slave pg_ctl: /usr/lib/postgresql10/bin/pg_ctl
slave pg_dump: /usr/lib/postgresql10/bin/pg_dump
slave pg_dumpall: /usr/lib/postgresql10/bin/pg_dumpall
slave pg_isready: /usr/lib/postgresql10/bin/pg_isready
slave pg_receivewal: /usr/lib/postgresql10/bin/pg_receivewal
slave pg_recvlogical: /usr/lib/postgresql10/bin/pg_recvlogical
slave pg_resetwal: /usr/lib/postgresql10/bin/pg_resetwal
slave pg_restore: /usr/lib/postgresql10/bin/pg_restore
slave pg_rewind: /usr/lib/postgresql10/bin/pg_rewind
slave pg_waldump: /usr/lib/postgresql10/bin/pg_waldump
slave postgres: /usr/lib/postgresql10/bin/postgres
slave postmaster: /usr/lib/postgresql10/bin/postmaster
slave psql: /usr/lib/postgresql10/bin/psql
slave reindexdb: /usr/lib/postgresql10/bin/reindexdb
slave vacuumdb: /usr/lib/postgresql10/bin/vacuumdb
/usr/lib/postgresql13 - priority 130
slave clusterdb: /usr/lib/postgresql13/bin/clusterdb
slave createdb: /usr/lib/postgresql13/bin/createdb
slave createuser: /usr/lib/postgresql13/bin/createuser
slave dropdb: /usr/lib/postgresql13/bin/dropdb
slave dropuser: /usr/lib/postgresql13/bin/dropuser
slave ecpg: /usr/lib/postgresql13/bin/ecpg
slave initdb: /usr/lib/postgresql13/bin/initdb
slave pg_basebackup: /usr/lib/postgresql13/bin/pg_basebackup
slave pg_checksums: /usr/lib/postgresql13/bin/pg_checksums
slave pg_config: /usr/lib/postgresql13/bin/pg_config
slave pg_controldata: /usr/lib/postgresql13/bin/pg_controldata
slave pg_ctl: /usr/lib/postgresql13/bin/pg_ctl
slave pg_dump: /usr/lib/postgresql13/bin/pg_dump
slave pg_dumpall: /usr/lib/postgresql13/bin/pg_dumpall
slave pg_isready: /usr/lib/postgresql13/bin/pg_isready
slave pg_receivewal: /usr/lib/postgresql13/bin/pg_receivewal
slave pg_recvlogical: /usr/lib/postgresql13/bin/pg_recvlogical
slave pg_resetwal: /usr/lib/postgresql13/bin/pg_resetwal
slave pg_restore: /usr/lib/postgresql13/bin/pg_restore
slave pg_rewind: /usr/lib/postgresql13/bin/pg_rewind
slave pg_verifybackup: /usr/lib/postgresql13/bin/pg_verifybackup
slave pg_waldump: /usr/lib/postgresql13/bin/pg_waldump
slave postgres: /usr/lib/postgresql13/bin/postgres
slave postmaster: /usr/lib/postgresql13/bin/postmaster
slave psql: /usr/lib/postgresql13/bin/psql
slave reindexdb: /usr/lib/postgresql13/bin/reindexdb
slave vacuumdb: /usr/lib/postgresql13/bin/vacuumdb
And we have:
rleap15-3:~ # which pg_config
/usr/bin/pg_config
rleap15-3:~ # pg_config --version
PostgreSQL 13.9
Closing as: Fixed by #38
Thanks to @FroggyFlox & forum members agjbond007 & anborn; for helping to identify this issue. It is currently supposed that, as a result of zypper dup OS version transitions, given examples were (15.3->15.4) & (15.2->15.3->15.4) the, required for Poetry venv build, pg_config file can become unrepresented: i.e. no longer having an alternatives link. This file, as installed by our dependence on:
Is normally available via:
However, during a zypper dup, the new default postgresql version of 14 is installed as per agjbond007 report in the linked forum thread:
But in the above we see that there is no counterpart to the postgresql13-server-devel installed in the 14 variant, and thus no counterpart provider (via alternatives) of our required pg_config - used by our Poetry dependencies manager to build our Python dependencies upon install/update.
The fix provided by @FroggyFlox in the linked forum thread is to re-assert our dependency upon postgresql13 (and it's server-devel counterpart) via a move away from the auto alternative (as higher priority due to newer) which has unfortunately obscured (removed from alternative managed path) the requried for venv build 'pg_config' utility.
The following shows the by-hand intervention currently required for installs that have previously been 'zypper dup' (distribution updated) from a prior Leap version:
Proposal
We currently have an rpm defined dependency on postresql13 and it's associated server and server-devel packages so rather than move all these dependency over the the newer, OS default, of 14, we should assert our system requirement via the alternative system. At least until we update our own client library of (from pyproject.toml):
This older dependency, that is questionable re Postgresql 13, should likely not be tried further with postgresql 14. In the context of our master and testing branches currently span Python 2.7 / 3.6.
This proposed postgresql alternatives assertion could be accomplished within a scriptlet, prior to our Poetry venv build, and post our new rpm/scriptlets install (which would have already installed our dependencies): e.g. %post.
Referenced:
SuSe SLE: https://documentation.suse.com/sles/15-SP5/html/SLES-all/cha-update-alternative.html
Forum threads: -- agjbond007 - https://forum.rockstor.com/t/upgrade-to-5-0-1-0-from-4-6-1-rockstor-fails/8905 -- anborn - https://forum.rockstor.com/t/system-unavailable-after-update-to-stable-4-6-1-0-release/8904