problem trying to install postgresql

Operating System & Version
AlmaLinux v8.7.0 STANDARD
cPanel & WHM Version
110.0.2

chepegeek

Member
Apr 27, 2023
5
2
78
mexico
cPanel Access Level
Root Administrator
I want to comment that this problem arises when I install imunify360, apparently I deactivate the repositories, I can't find how to activate them, I sense that this is my problem due to the error that appears in the terminal, below I will show you what my problem is about, I would appreciate your help friends.

[root@servidor ~]# /usr/local/cpanel/scripts/installpostgres
This script installs PostgreSQL 9.2.x or later.
If your system runs an older version of PostgreSQL, you must
dump your databases to a file, and then restore them after
installation.
PostgreSQL 9.2.x is NOT backwards compatible.
If no PostgreSQL databases exist on your system, run the
following command to force the creation of a PostgreSQL 9.2.x -style
setup:
mv /var/lib/pgsql /var/lib/pgsql.old
systemctl restart postgresql
Do not run this command if databases exist that you wish to keep!
Are you certain that you wish to proceed? [y/(n)]:y
info [installpostgres] Installing Postgres...
Last metadata expiration check: 2:05:36 ago on Thu Apr 27 07:57:38 2023.
Package libpq5-15.2-42.1PGDG.rhel8.x86_64 is already installed.
Error:
Problem: installed package libpq5-15.2-42.1PGDG.rhel8.x86_64 obsoletes libpq provided by libpq-13.5-1.el8.x86_64
- package libpq-devel-13.5-1.el8.x86_64 requires libpq(x86-64) = 13.5-1.el8, but none of the providers can be installed
- cannot install the best candidate for the job
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
(XID g74g6m) “/usr/bin/yum” informó el código de error “1” cuando finalizó:
“/usr/bin/yum” reported error code “1” when it ended:
info [installpostgres] Updating postgresql configuration now...
Failed to locate postgresql CLI application
info [installpostgres] Attempting to restart postgresql...
The PostgreSQL installation failed!
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,505
2,605
363
cPanel Access Level
Root Administrator
Hey there! Can you post the output of the following command?

Code:
rpm -qa | grep libpq
I see the following on my AlmaLinux 8 system:

Code:
# rpm -qa | grep libpq
libpq-devel-13.5-1.el8.x86_64
libpq-13.5-1.el8.x86_64
If you think another repository may be interfering with this, you could do the following to confirm where that version is coming from:

Code:
yum whatprovides libpq
 

chepegeek

Member
Apr 27, 2023
5
2
78
mexico
cPanel Access Level
Root Administrator
obtuve lo siguiente:
libpq5-15.2-42.1PGDG.rhel8.x86_64




Última comprobación de caducidad de metadatos: hace 0:01:38 el domingo 30 de abril de 2023 a las 10:02:52 a. m. CST.
libpq-13.5-1.el8.i686: biblioteca cliente de PostgreSQL
Repositorio: flujo de aplicaciones
Emparejado desde:
Proporcione: libpq = 13.5-1.el8

libpq-13.5-1.el8.x86_64: biblioteca cliente de PostgreSQL
Repositorio: flujo de aplicaciones
Emparejado desde:
Proporcione: libpq = 13.5-1.el8

libpq5-15.1-42PGDG.rhel8.x86_64: biblioteca cliente de PostgreSQL
Repo: pgdg-común
Emparejado desde:
Proporcionar: libpq >= 10.0

libpq5-15.2-42.1PGDG.rhel8.x86_64: biblioteca cliente de PostgreSQL
Repositorio: @System
Emparejado desde:
Proporcionar: libpq >= 10.0

libpq5-15.2-42.1PGDG.rhel8.x86_64: biblioteca cliente de PostgreSQL
Repo: pgdg-común
Emparejado desde:
Proporcionar: libpq >= 10.0
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,505
2,605
363
cPanel Access Level
Root Administrator
Thanks for that output. It would seem your 15.2 version was installed from the pgdg-common repository. You would want to uninstall that version of PostGreSQL, disable that repository, and then perform the standard cPanel installation to ensure the supported version is installed.
 

chepegeek

Member
Apr 27, 2023
5
2
78
mexico
cPanel Access Level
Root Administrator
Gracias por esa salida. Parecería que su versión 15.2 se instaló desde el repositorio pgdg-common. Le gustaría desinstalar esa versión de PostGreSQL, deshabilitar ese repositorio y luego realizar la instalación estándar de cPanel para asegurarse de que la versión compatible esté instalada.
[/CITA]
how do i do it Could you guide me to do it, thank you very much
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,505
2,605
363
cPanel Access Level
Root Administrator
First you would want to remove that version of PostGreSQL on the server:

Code:
rpm -e libpq5-15.2-42.1PGDG.rhel8.x86_64
Then you'll need to disable the repository:

Code:
yum --disablerepo=REPONAME
You'll just replace "REPONAME" from the example with your specific repository. I wasn't able to include that in my example, but you can check the /etc/yum.repos.d directory for the full list, and you'll likely see something like "pgsqlcommon" or a similar name.

Then run the cPanel installer for PostGreSQL to complete the task:

Code:
/scripts/installpostgres
Let me know if you run into any trouble with that!