Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency error with yum on CentOS 8 #2691

Open
mennowo opened this issue Nov 27, 2020 · 12 comments
Open

Dependency error with yum on CentOS 8 #2691

mennowo opened this issue Nov 27, 2020 · 12 comments

Comments

@mennowo
Copy link

mennowo commented Nov 27, 2020

System:

  • OS: CentOS 8
  • PostgreSQL version: 12.1
  • Installation method: yum

When trying to install TimescaleDB on CentOS 8, I get an error with yum. I installed postgres 12 as provided by the os: dnf module enable postgresql:12 and then dnf install postgresql-server. Then when trying to install timescale I get: "nothing provides postgresql12 >= 12 needed by timescaledb-postgresql-12-1.7.4.0.el8.x86_64". I believe this could be fixed by changing the dependency of the package to "postgresql >= 12".

@mennowo
Copy link
Author

mennowo commented Dec 2, 2020

A small followup. Using this command:

dnf -qy module disable postgresql

the dependency error will disappear, and timescale can install under CentOS.

Nonetheless, it would be better to correct the dependencies, as "postgresql12 >= 12" does not make much sense to begin with. The solution would be to alter the SPEC file for timescale, changing

Requires: postgresql12 >= 12
Requires: postgresql12-server >= 12

to

Requires: postgresql >= 12
Requires: postgresql-server >= 12

This will still work with the RPMs as provided by postgres in their PGDG repos, but will also enable using the version of Postgresql provided in RHEL/CentOS 8 through appstream.

I'd happily test this for both approaches and do a PR, but the .spec file for the RPM packege is not in the repository.

On a sidenote: the RPMs are advertised as signed, while they actually are not.

@mennowo
Copy link
Author

mennowo commented Jan 22, 2021

Any hope for a resolution for this issue? It should be an easy fix an will help ease deployment of timescale in RHEL environments, cause RedHat provides support on postges as long as it is deployed via appstream.

@svenklemm
Copy link
Member

Unfortunately your suggested solution would break when system postgres is disabled.

https://serverfault.com/questions/411444/rpm-set-required-somepackage-0-5-0-and-somepackage-0-6-0

@mennowo
Copy link
Author

mennowo commented Mar 2, 2021

Thanks for looking in to this. We looked a bit further and were able to find and fix the issue. It actually lies with the PGDG packages, which ignore version constraints.

Requires: postgresql-server >= 12, postgresql-server < 13

actually works. All RHEL8/AppStream postgresql versions respect this (tested on all versions). However, not all PGDG versions respect this:

  • postgresql10-server matches any version
  • postgresql11-server matches any version
  • postgresql12-server matches any version >= 12 (so 13 too)

Solution

Requires:       postgresql-server >= 12, postgresql-server < 13
Requires:       postgresql >= 12, postgresql < 13
Requires:       pkgconfig(libpq) >= 12
Conflicts:      postgresql96-server, postgresql10-server, postgresql11-server
Conflicts:      postgresql13-server, postgresql14-server, postgresql15-server
Conflicts:      postgresql96, postgresql10, postgresql11
Conflicts:      postgresql13, postgresql14, postgresql15

This is compatible for RHEL8/AppStream and PGDG repos as well.
I hope this makes it possible to switch to AppStream PostgreSQL soon.

Notes

  • The "Conflicts:" are workarounds for wrong "Provides" statements in PGDG packages. Another option would be to rely on Administrators to enable the right repo in which case you can omit the "Conflicts:" statements. Needless to say, using these Conflicts is robust.
  • pkgconfig(libpq) installs libpq-devel-12.x and provides /usr/bin/pg_config as the AppStream version of /usr/pgsql-12/bin/pg_config (PGDG) but provides different output. The most safe way is to consider the PGDG version prio1 (although in the end, technically it is possible to have both PGDG and AppStream PosgreSQL installed). The timescaledb-postgresql-12 scriptlet (%post?) can retrieve the right pg_config using something like:
    pg_config=$(PATH=/usr/pgsql-12/bin:$PATH type -P pg_config) # and use $pg_config instead

Setup for PGDG

dnf module -y disable postgresql
dnf install timescaledb-postgresql-12
postgresql-12-setup initdb
sudo -u postgres timescaledb-tune -pg-config /usr/pgsql-12/bin/pg_config # -yes
systemctl start  postgresql12.service
systemctl enable postgresql12.service

Setup for AppStream

dnf module -y reset postgresql; dnf module -y enable postgresql:12
dnf install timescaledb-postgresql-12-NEW
postgresql-setup --initdb
sudo -u postgres timescaledb-tune -conf-path /var/lib/pgsql/data
systemctl start  postgresql.service
systemctl enable postgresql.service

Setup for AppStream using same datadir as PGDG
multiple solutions ready including migration plan

Background

I created a postgresql12-appstream meta-package and tested any possible Requires & Conflicts constraints (many rpmbuild actions). Results for all RHEL8/AppStream postgresql versions using extreme tests/variants are OK. However, the (external) PGDG packages ignore version constraints.
Conclusion: cause is incorrect version constraints in the PGDG packages (see below).

# rpm -q --provides postgresql10-server
config(postgresql10-server) = 10.10-1PGDG.rhel8
postgresql-server
postgresql10-server = 10.10-1PGDG.rhel8
postgresql10-server(x86-64) = 10.10-1PGDG.rhel8

Problem here is, any version of postgresql-server will match

# rpm -q --provides postgresql11-server
config(postgresql11-server) = 11.11-1PGDG.rhel8
postgresql-server >= 11.11-1PGDG.rhel8
postgresql11-server = 11.11-1PGDG.rhel8
postgresql11-server(x86-64) = 11.11-1PGDG.rhel8

Problem here is, any version >= 11 of postgresql-server will match (12 too!); even stranger, Requires: postgresql-server < 11 matches too(!) for some reason

# rpm -q --provides postgresql12-server
config(postgresql12-server) = 12.6-1PGDG.rhel8
postgresql-server >= 12.6-1PGDG.rhel8
postgresql12-server = 12.6-1PGDG.rhel8
postgresql12-server(x86-64) = 12.6-1PGDG.rhel8

Problem here is, any version >= 12 of postgresql-server will match (13 too!); but not stranger here, Requires: postgresql-server < 12 will not match (which is OK)

Side note

I noticed timescaledb-postgresql-12 leaves files around not owned by any package:

/usr/lib64/timescaledb-loader-pg12
/usr/lib64/timescaledb-pg12
/usr/lib64/pgsql/timescaledb-1.7.5.so
/usr/lib64/pgsql/timescaledb-tsl-1.7.5.so
/usr/lib64/pgsql/timescaledb.so
/usr/share/pgsql/extension/timescaledb* (47 files here)

Maybe nice to make those files really part of the package ...

And last but not least, we would appreciate GPG-signed packages.

@mennowo
Copy link
Author

mennowo commented Apr 7, 2021

Any chance for a follow-up on this one? The provided solution should work as-is.

@svenklemm
Copy link
Member

Hmm those conflict lines will prevent the installation of multiple major postgres versions, i guess you cant do that with the system package but you certainly can with the packages from the PGDG repo.

@mennowo
Copy link
Author

mennowo commented Apr 28, 2021

You can leave out any 'Conflicts:' statements as you see fit; the approach will still be an easy way to allow Timescale to work with both Appstream and PGDG on CentOS/RHEL. Would be great to have this!

@demianph
Copy link

RHEL 8.4 appstream modules includes postrgresql versions through 13.3, Any chance we can get timescale to work with it?
Running into some kind of issue where the PGDG repo just times out (possible corporate security).

@aliensmily
Copy link

aliensmily commented Apr 29, 2022

We are installing postgresql from RHEL8 appstream too, Would be nice to have the possibility to install TimescaleDB from a repository...

@lumarel
Copy link

lumarel commented Oct 20, 2023

As this topic looks like it has started sleeping, is there any progress to support the RHEL provided (and especially supported) PostgreSQL packages?

@bhill0
Copy link

bhill0 commented Jan 16, 2024

Just to add to this: I have run into the same with RHEL 9.3 provided PostgreSQL as well:

rpm -qa | grep postgres
postgresql-private-libs-13.13-1.el9_3.x86_64
postgresql-13.13-1.el9_3.x86_64
postgresql-server-13.13-1.el9_3.x86_64
dnf install -y timescaledb-2-postgresql-13
....
Error: 
 Problem: cannot install the best candidate for the job
  - nothing provides postgresql13 >= 13.4 needed by timescaledb-2-postgresql-13-2.13.1-0.el9.x86_64 from timescale_timescaledb
  - nothing provides postgresql13-server >= 13.4 needed by timescaledb-2-postgresql-13-2.13.1-0.el9.x86_64 from timescale_timescaledb

@YBUSherb
Copy link

Would also appreciate if timescaledb would be usable with RHEL8 or RHEL9 postgresql appstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants