Shiwangini
Shiwangini

Reputation: 836

libpq.so.5 file is not available while installing postgres-12

I have installed postgres-11 already on my machine. libpq.so.5 file is there already into /usr/pgsql-11/lib directory. However, now I need to upgrade to 12. I ran below commands:

   yum install postgresql12-server postgresql12 -y

Then, I go with initialize step and got below error:

   /usr/pgsql-12/bin/postgresql-12-setup initdb
   Initializing database ... failed, see /var/lib/pgsql/12/initdb.log
  
   cat /var/lib/pgsql/12/initdb.log
   /usr/pgsql-12/bin/initdb: error while loading shared libraries: 
   libpq.so.5: cannot open shared 
   object file: No such file or directory

Then,I started searching for this file into my postgresql-12 directory and didn't find any file there. However, this file was present into pgsql-11 directory structure:

   cat /var/lib/pgsql/12/initdb.log
  /usr/pgsql-12/bin/initdb: error while loading shared libraries: libpq.so.5: 
   cannot open shared 
   object file: No such file or directory

As per available searches - created a link like below to avoid the error:

    ln -s /usr/pgsql-11/lib/libpq.so.5 /usr/lib64/libpq.so.5

And after this I was able to initialize the db successfully and perform upgrade. But, when I tried to connect psql after starting services for 12 after upgrade- I got below error:

    sudo su - postgres -c "psql"
    psql (12.3)
    psql: symbol lookup error: psql: undefined symbol: PQgssEncInUse

After this , I'm stuck at this error and unable to connect psql. I have below 2 questions now:

  1. Why libpq.so.5 file is not available into postgres-12 directory structure?
  2. How to avoid PQgssEncInUse error or what is causing this error?

Any help will be appreciated.

Upvotes: 2

Views: 3997

Answers (1)

TPS
TPS

Reputation: 518

I got the same error, to resolve this, I removed libpq-11.5-1 package as well along with postgres:

yum remove libpq-* postgresql-*

and then installed postgresql-12.17

yum install postgresql-12.17

Upvotes: 0

Related Questions