I'm working on a Zabbix installation on Centos 8 Stream, and have run into a situation where a failed installation of postgresql is interfering with a new installation. I am getting the error psql: /lib64/libpq.so.5: no version information available (required by psql) after installation when I go to use postgre to set up users and initialize.
I have a few different postgre options available in the appstream, and have changed the default version to no avail.
I have looked at various solutions on SO and DBA such as:
and
How can I fix this error?
As I was going through posts and various resources, I found what was causing my error and how to fix it. As it's different than what I've seen, here are the steps I found to fix it.
Installing:
postgresql-server x86_64 10.23-2.module_el8+572+929c87ac appstream 5.1 M
Installing dependencies:
libpq5 x86_64 18.0-1PGDG.rhel8 pgdg-common 281 k
postgresql x86_64 10.23-2.module_el8+572+929c87ac appstream 1.6 M
Note that the source for the postgre is the appstream, and the source for the lib is pgdg-common. This is where the conflict is occuring.
First confirm all the enable repos -
sudo dnf repolist all
There should be several pgdg entries. Look in the repos directory /etc/yum.repos/d for the name of the repo, it should be something like pgdg-redhat-all.repo, and move that to a backup file.
sudo mv pgdg-redhat-all.repo pgdg-redhad-all.repo.bak
Reinstall the postgre-sql libs
sudo dnf reinstall postgresql-libs
Now the command
sudo dnf install postgresql-server
Should produce output similar to below, and note the change in source from pgdg to appstream for the library:
Installing:
postgresql-server x86_64 10.23-2.module_el8+572+929c87ac appstream 5.1 M
Installing dependencies:
libpq x86_64 13.5-1.el8 appstream 198 k
postgresql x86_64 10.23-2.module_el8+572+929c87ac appstream 1.6 M