7

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
  • Please don't put text images in questions - put the text. That screenshot in particular is painful to read. – Daniel Farrell Oct 8 at 3:20
  • 1
    Looking at the contents of the repo, that looks like it should work… does dnf search postgresql find the packages? – Ulrich Schwarz Oct 8 at 6:14
1

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

  • Is this an inverted way of saying to use --repo pgdg12 as a solution to the OP's problem? – Jeff Schaller Oct 8 at 12:38
  • dnf config-manager --enable pgdg12 is something you should run anyway. Version 12 repo isn't enabled by default. However @EOhm has the correct solution below, dnf --disablerepo AppStream install postgresql12-server does the trick and even installs dependencies. – Jari Turkia Dec 3 at 17:47
2

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.

  • 1
    So to say to discussion at @venci Petros answer: dnf --disablerepo AppStream install postgresql12 would also do the trick. But You would need to do this for every I assume. – EOhm Oct 8 at 21:46
  • > Alternative and more comfortable solution: add module_hotfixes=true to the pgdg repo definitions - This was the proper solution for me as it enabled dnf to pull in the Python 2 libs some of the Postgres modules required. – kermatt Nov 6 at 17:02
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.