CentOS 7 install PostgreSQL dependency error

centospostgresqlyum

When running yum install postgresql-server.x86_64, I encounter the following error:

--> Processing Dependency: libreadline.so.5()(64bit) for package: postgresql-server-8.1.23-10.el5_10.x86_64
--> Finished Dependency Resolution
Error: Package: postgresql-8.1.23-10.el5_10.x86_64 (el5_latest)
           Requires: libreadline.so.5()(64bit)
           Available: readline-5.1-3.el5.x86_64 (el5_latest)
               libreadline.so.5()(64bit)
           Installed: readline-6.2-9.el7.x86_64 (@anaconda)
              ~libreadline.so.6()(64bit)
Error: Package: postgresql-8.1.23-10.el5_10.x86_64 (el5_latest)
           Requires: libtermcap.so.2()(64bit)
           Available: libtermcap-2.0.8-46.1.x86_64 (el5_latest)
               libtermcap.so.2()(64bit)
Error: Package: postgresql-server-8.1.23-10.el5_10.x86_64 (el5_latest)
           Requires: libreadline.so.5()(64bit)
           Available: readline-5.1-3.el5.x86_64 (el5_latest)
               libreadline.so.5()(64bit)
           Installed: readline-6.2-9.el7.x86_64 (@anaconda)
              ~libreadline.so.6()(64bit)
Error: Package: postgresql-server-8.1.23-10.el5_10.x86_64 (el5_latest)
           Requires: libtermcap.so.2()(64bit)
           Available: libtermcap-2.0.8-46.1.x86_64 (el5_latest)
               libtermcap.so.2()(64bit)

My first guess was that I didn't have readline installed, but it turns out that this is not the issue:

~ % yum list installed|grep readline
readline.x86_64                 6.2-9.el7                              @anaconda
readline-devel.x86_64           6.2-9.el7                              @base

I am assuming there is still a missing dependency.

The error message itself is a bit cryptic – what can I do to resolve this and resume installation?

Best Answer

The packages that you are trying to install actually depend on an older version of CentOS.

Notice in your error message, you reference the el5_latest repository, which is for CentOS 5 or RHEL 5, but you have CentOS 7 installed. The major versions are not compatible.

The oldest version of PostgreSQL available for CentOS 7 is version 9.3. You can install it with these commands:

rpm -iUvh http://yum.postgresql.org/9.3/redhat/rhel-7-x86_64/pgdg-centos93-9.3-1.noarch.rpm
yum -y install postgresql93-server

The latest version of PostgreSQL available for CentOS 7 (at the time of writing) is version 9.4. You can install it with these commands:

rpm -Uvh http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-1.noarch.rpm
yum install postgresql94-server