Skip to main content

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

I am trying to install postgresql-12 in CentOS-8 I added the postgresql repository according to postgresql.org website https://www.postgresql.org/download/linux/redhat/

dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

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

Question Credit: Cloud-Lover
Question Reference
Asked October 9, 2019
Posted Under: Unix Linux
10 views
2 Answers

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 ...


credit: Stephen Kitt
Answered October 9, 2019

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.


credit: EOhm
Answered October 9, 2019
Your Answer