PostgreSQL on CentOS 8 and RHEL 8 – Noobient

PostgreSQL on CentOS 8 and RHEL 8

According to the PostgreSQL Red Hat family download site, all you need to do now is:

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

But guess what:

# dnf install postgesql12-server
Last metadata expiration check: 0:04:17 ago on Tue 26 Nov 2019 02:41:18 PM CET.
No match for argument: postgesql12-server
Error: Unable to find a match

Soo, where is the Postgres server package?

# dnf list "postgresql*-server"
Last metadata expiration check: 0:07:35 ago on Tue 26 Nov 2019 02:41:18 PM CET.
Available Packages
postgresql-server.x86_64       10.6-1.module_el8.0.0+15+f57f353b       AppStream

Weird. Then you might try disabling the AppStream repo:

dnf --disablerepo AppStream

But that contains like 70% of all packages now, including the JDK and other rather crucial packages, so it’s really not an option.

You can also try explicitly selecting the repo during install, like:

dnf --repo pgdg12 install postgresql12-server

But nope, that will not work properly either, since it restricts your command to that one repo, and if you have dependencies in other repos, it will fail. For example, Postgres depends on libicu in Base. It’s only a matter of time before you shoot yourself in the foot.


After all, the problem is that EL8 indtroduced the concept of AppStream, and the Postgres repo hasn’t been updated to reflect that approach. The best workaround I could find is to disabling the postgresql stream module in AppStream, unblocking the postgres packages in the pgdg repos:

dnf module disable postgresql

Then a quick glance:

# dnf list "postgresql*-server"
Last metadata expiration check: 0:08:00 ago on Tue 26 Nov 2019 02:41:18 PM CET.
Available Packages
postgresql10-server.x86_64               10.11-1PGDG.rhel8                pgdg10
postgresql11-server.x86_64               11.6-1PGDG.rhel8                 pgdg11
postgresql12-server.x86_64               12.1-1PGDG.rhel8                 pgdg12
postgresql94-server.x86_64               9.4.25-1PGDG.rhel8               pgdg12
postgresql94-server.x86_64               9.4.25-1PGDG.rhel8               pgdg94
postgresql95-server.x86_64               9.5.20-1PGDG.rhel8               pgdg95
postgresql96-server.x86_64               9.6.16-1PGDG.rhel8               pgdg96

That’s more like it.