0

I'm using an EC2 on AWS running Amazon Linux 2. I'm trying to install Postgresql version 15 server along with the contrib libraries for various extension.

This is how I installed Posgres15

sudo rpm --import https://yum.postgresql.org/RPM-GPG-KEY-PGDG-15
sudo yum update -y
sudo yum install -y postgresql15-server postgresql15-contrib

PostgreSQL server installs correctly but fails during the contrib package install due to a dependency on Python. I am able to install just the server and right it fine via sudo yum install -y postgresql15-server.

Here is the error I get when installing postgresql15-contrib:

[ec2-user@ip-172-31-51-199 ~]$ sudo yum install -y  postgresql15-contrib 
Loaded plugins: dkms-build-requires, extras_suggestions, langpacks, priorities, update-motd
225 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package postgresql15-contrib.x86_64 0:15.2-1PGDG.rhel7 will be installed
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: postgresql15-contrib-15.2-1PGDG.rhel7.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: postgresql15-contrib-15.2-1PGDG.rhel7.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: postgresql15-contrib-15.2-1PGDG.rhel7.x86_64
--> Processing Dependency: libxslt.so.1()(64bit) for package: postgresql15-contrib-15.2-1PGDG.rhel7.x86_64
--> Processing Dependency: libpython3.6m.so.1.0()(64bit) for package: postgresql15-contrib-15.2-1PGDG.rhel7.x86_64
--> Running transaction check
---> Package libxslt.x86_64 0:1.1.28-6.amzn2 will be installed
---> Package postgresql15-contrib.x86_64 0:15.2-1PGDG.rhel7 will be installed
--> Processing Dependency: libpython3.6m.so.1.0()(64bit) for package: postgresql15-contrib-15.2-1PGDG.rhel7.x86_64
--> Finished Dependency Resolution
Error: Package: postgresql15-contrib-15.2-1PGDG.rhel7.x86_64 (pgdg15)
           Requires: libpython3.6m.so.1.0()(64bit)
           Available: python3-libs-3.6.2-3.amzn2.0.2.x86_64 (amzn2extra-python3)
               libpython3.6m.so.1.0()(64bit)
           Available: python3-libs-3.6.2-3.amzn2.0.3.x86_64 (amzn2extra-python3)
               libpython3.6m.so.1.0()(64bit)
           Installed: python3-libs-3.7.16-1.amzn2.0.2.x86_64 (@amzn2-core)
              ~libpython3.7m.so.1.0()(64bit)
           Available: python3-libs-3.7.0-0.12.b2.amzn2.0.2.x86_64 (amzn2-core)
              ~libpython3.7m.so.1.0()(64bit)
           Available: python3-libs-3.7.0-0.16.b3.amzn2.0.1.x86_64 (amzn2-core)
              ~libpython3.7m.so.1.0()(64bit)
           Available: python3-libs-3.7.0-0.20.rc1.amzn2.0.1.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.0-0.20.rc1.amzn2.0.2.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.1-9.amzn2.0.1.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.2-4.amzn2.0.1.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.3-1.amzn2.0.1.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.3-1.amzn2.0.2.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.4-1.amzn2.0.1.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.4-1.amzn2.0.2.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.4-1.amzn2.0.3.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.4-1.amzn2.0.4.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.6-1.amzn2.0.1.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.8-1.amzn2.0.1.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.9-1.amzn2.0.1.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.9-1.amzn2.0.2.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.9-1.amzn2.0.3.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.10-1.amzn2.0.1.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.15-1.amzn2.0.1.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.15-1.amzn2.0.2.i686 (amzn2-core)
               Not found
           Available: python3-libs-3.7.16-1.amzn2.0.1.i686 (amzn2-core)
               Not found
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
[ec2-user@ip-172-31-51-199 ~]$ 

Python is definitely installed on the server and I can verify the version like this:

[ec2-user@ip-172-31-51-199 ~]$ python3 -V
Python 3.7.16
[ec2-user@ip-172-31-51-199 ~]$ 

And here is what I see when looking for the Python shared lib:

[ec2-user@ip-172-31-51-199 ~]$ sudo locate libpython
/home/ec2-user/timp/Python-3.6.12/libpython3.6m.a
/home/ec2-user/timp/Python-3.6.12/Tools/gdb/libpython.py
/usr/lib64/libpython2.7.so
/usr/lib64/libpython2.7.so.1.0
/usr/lib64/libpython3.7m.so.1.0
/usr/lib64/libpython3.8.so.1.0
/usr/lib64/libpython3.so
/usr/lib64/python2.7/config/libpython2.7.so
/usr/local/lib/libpython3.6m.a
/usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a
/usr/share/systemtap/tapset/libpython2.7-64.stp
[ec2-user@ip-172-31-51-199 ~]$ 

I've tried multiple ways of installing python, even version 3.6 specifically. I also compile python 3.6 from source and did a make install.

What am I missing? Why wont the postgresql15-contrib install find my python shared lib?

maxTrialfire
  • 532
  • 3
  • 16
  • The PostgreSQL development team provide rpm packages for Red Hat systems. Your Amazon Linux clearly has some differences. In particular that python library appears to be installed in a user directory and not as a shared object lib. Stick to Amazon approved repos if you aren't sure what you are doing. – Richard Huxton Apr 25 '23 at 06:17
  • A lot of RHEL7 stuff works fine on amazon linux 2. Sticking to AWS supported stuff is very limiting. Do any of us really know what we're doing @RichardHuxton ? Life is all about pushing into the unknown, like installing PG15 on AWS Linux2, surely I can't be the only one who's tried this? – maxTrialfire Apr 25 '23 at 23:58
  • I'm not going to come over and confiscate your keyboard:-) But if you're going to mix and match package sources you'll need to be comfortable working around library requirements – Richard Huxton Apr 26 '23 at 06:20

0 Answers0