For years, installing many packages from the PostgreSQL RPM repository on RHEL and its rebuilds started with the same step: `dnf install epel-release`. PostGIS, pgBackRest, pgcli, patroni, pg_statviz, ora2pg and lots of extensions pulled at least one dependency from EPEL.

Over the last couple of weeks I removed most of those dependencies. On RHEL 8, 9 and 10, the GIS stack, the most popular extensions and almost all of our Python tools now install from the PGDG repositories and the OS repositories (BaseOS, AppStream and CRB) alone.

Why?

EPEL is a great project, and this is not a complaint about it. But relying on it caused us real problems:

- Many sites cannot enable EPEL at all: Some companies only allow the vendor's repositories and the PGDG ones.
- Lifecycles do not match: EPEL packages get updated, rebuilt with new sonames or retired on EPEL's own schedule. When that happens, our packages that were built against them break, often without any change on
our side.
- Old versions: Many of the libraries we needed are kept at old versions in EPEL, some with known CVEs: EPEL 8 and 9 ship hdf5 1.10 and 1.12, Apache Arrow 8 and 9, netCDF 4.7 and 4.8.
- EPEL 10 minor releases: EPEL 10 follows RHEL 10 minor releases (10.2, 10.3, ...), which makes it harder to know which EPEL package a user actually ends up with.


What changed?

The GIS stack

GDAL needed more than 20 libraries from EPEL: hdf4, hdf5, netCDF, cfitsio, freexl, Apache Arrow, libkml, xerces-c, armadillo, libdeflate, GPSBabel and more. All of them are now in our repository, at their latest upstream versions instead of EPEL's. That includes Apache Arrow 26, which also gave GDAL its Parquet driver.

No GDAL driver was dropped (unlike RHEL's recent move). PostGIS 3.3 to 3.7, SFCGAL (built against our own CGAL packages now), osm2pgsql and pointcloud do not need EPEL on any RHEL version anymore. PostGIS also lost a couple of stale dependencies (hdf5, xerces-c) it never used directly.

Extensions and tools

- pgBackRest links against our own libssh2 (with the Fedora CVE patches), so SFTP repositories work without EPEL.
- pgsodium and pg_pwhash use our own libsodium, libargon2 and libscrypt. As a bonus, pgsodium's ipcrypt functions now work on RHEL 8 and 9 too, and pg_pwhash supports scrypt on RHEL 10.
- mongo_fdw and postgresbson use our own mongo-c-driver (1.30).
- pguri uses our own uriparser.
- pg_top and pgmoneta do not depend on libbsd and cJSON anymore.
- ora2pg: perl-String-Random is now in our repository.

Python

This was the largest part of the work:

- RHEL 8: pgcli, patroni and the other Python tools now use a Python 3.12 stack built entirely by us, including pyproject-rpm-macros.
- RHEL 9: the pgcli stack, typing-extensions for psycopg 3, and pillow (built against our own libimagequant) no longer come from EPEL.
- RHEL 10: about 35 Python modules are now built by us, from boto3 and pydantic to matplotlib and pandas. pg_statviz, patroni, barman, pgcli, pg_activity, pgldapsync, pghoard, rohmu and sshtunnel all install with EPEL disabled.
- pgldapsync runs with Python 3.12 on RHEL 8 and 9 now, with our own ldap3 module, instead of needing python3-ldap3 from EPEL.

How does it work?

Most of the new libraries are installed under their own prefix: `/usr/pgdg-hdf5`, `/usr/pgdg-libarrow`, `/usr/pgdg-libssh2`, and so on. Our packages find them through the rpath. There are no `ld.so.conf.d` files, and the libraries do not show up in the RPM provides. So they never replace the EPEL versions and cannot conflict with them. You can keep EPEL enabled, and software you installed from EPEL keeps using EPEL's libraries, while our packages use ours.

The RHEL 10 Python modules are different: a Python module can only be installed once, so ours replace EPEL's. Our python3.12- packages obsolete the matching EPEL python3- packages, and their release numbers start from 42, so a plain `dnf upgrade` with both repositories enabled switches you to our packages.

EPEL also splits some of these modules into subpackages and "extras" metapackages, such as `python3-matplotlib-tk`, `python3-pillow-tk`, `python3-pydantic+email`, `python3-httpx+socks` or the `fonttools` command line tools, and those require EPEL's exact version of the main package. We build the same subpackages (`python3.12-matplotlib-tk`, `python3.12-pydantic+email`, ...), and they replace EPEL's, so you keep the Tk backends, the command line tools and the optional dependencies you had.

Two things to note:

- `python3-snappy` goes from EPEL's 0.7.2 to our 0.6.1, as our package carries an Epoch.
- EPEL's packages also obsolete our package names, up to their own version. We keep our RHEL 10 versions at or above EPEL's, so that an EPEL update does not switch you back.

CRB (PowerTools on RHEL 8-) is still required, as before.

What still needs EPEL?

A few packages still need EPEL, mostly because the dependency is a large project of its own, or EPEL-only by nature:

- the Nagios plugins (check_patroni, check_pgactivity, check_pgbackrest) need nagios-plugins,
- plr, dbt2 and dbttools need R,
- firebird_fdw and libfq need Firebird,
- tds_fdw and pgloader need FreeTDS,
- pg_snakeoil needs ClamAV,
- pgbadger needs perl-Text-CSV_XS, and postgresql_autodoc perl-HTML-Template,
- on RHEL 10, pgpool-II and pgmemcache need libmemcached-awesome, and pgcopydb needs gc,
- on RHEL 9, pgmodeler needs Qt 6.

If one of these matters to you, please tell us at https://github.com/pgdg-packaging/pgdg-rpms/issues . The overall work is
tracked in https://github.com/pgdg-packaging/pgdg-rpms/issues/422 .

As always, please report any problems you hit with these packages.

Enjoy!

No comments

The author does not allow comments to this entry