install postgresql-12 in CentOS-8 got No match for argument: postgresql12

I am trying to install postgresql-12 in CentOS-8
I added the postgresql repository according to website

dnf install

so now I have the repository added

[root@centos8cmd ~]# dnf repolist
Last metadata expiration check: 0:08:03 ago on Tue 08 Oct 2019 03:29:54 AM GMT.
repo id                                                          repo name                                                                                             status
AppStream                                                        CentOS-8 - AppStream                                                                                  4,928
BaseOS                                                           CentOS-8 - Base                                                                                       2,713
*epel                                                            Extra Packages for Enterprise Linux 8 - x86_64                                                        1,816
extras                                                           CentOS-8 - Extras                                                                                         3
pgdg10                                                           PostgreSQL 10 for RHEL/CentOS 8 - x86_64                                                                509
pgdg11                                                           PostgreSQL 11 for RHEL/CentOS 8 - x86_64                                                                531
pgdg12                                                           PostgreSQL 12 for RHEL/CentOS 8 - x86_64                                                                382
pgdg94                                                           PostgreSQL 9.4 for RHEL/CentOS 8 - x86_64                                                               188
pgdg95                                                           PostgreSQL 9.5 for RHEL/CentOS 8 - x86_64                                                               327
pgdg96                                                           PostgreSQL 9.6 for RHEL/CentOS 8 - x86_64                                                               487
[root@centos8cmd ~]#

but when I try to initiate the commands

dnf install postgresql12
dnf install postgresql12-server

I got the following message !!

No match for argument: postgresql12
Error: Unable to find a match
Asked By: Cloud-Lover


Try :

sudo dnf --repo pgdg12 install  postgresql12-server.x86_64
sudo dnf --repo pgdg12 list

Without --repo pgdg12, this does not work for me.

Still looking for the reason for this behavior …

Answered By: Venci Petrov

Alternative and more comfortable solution: add module_hotfixes=true to the pgdg repo definitions or disable the AppStream modules You will probably never want to use if You use pgdg build (dnf -y module disable postgresql).
This is needed, from what I understand, because of the new modules system introduced with EL8.
The pgdg packages are filtered by default if dnf detects that they provides things that are also in modules but are not packaged as appropriate modules themselves.

I don’t know how to define modules in yum repos but if pgdg would do so it would probably be possible without that or even better be able to handle them as modules like the other AppStream modules (at least similar as afaik the module versions are not made for parallel installation but only for choice if major version).
Or if they would change their package signatures (I think it is related to the provide postgresql) the filter would not filter them by default.

Answered By: EOhm

You need to disable the postgresql stream module in AppStream, unblocking the postgres packages in the pgdg repos:

dnf module disable postgresql

For details, refer to PostgreSQL on CentOS 8 and RHEL 8

Answered By: bviktor
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.