1

I have trouble installing postgresql with apt.

postgresql-9.1 (or postgresql-9.3) installation fails with:

* Starting PostgreSQL 9.1 database server
* Error: could not exec /usr/lib/postgresql/9.1/bin/pg_ctl /usr/lib/postgresql/9.1/bin/pg_ctl start -D /var/lib/postgresql/9.1/main -l  /var/log/postgresql/postgresql-9.1-main.log -s -o  -c  config_file="/etc/postgresql/9.1/main/postgresql.conf" :
                                                                                                                                                                                                                               [fail]
invoke-rc.d: initscript postgresql, action "start" failed.

When I try executing /usr/lib/postgresql/9.1/bin/pg_ctl /usr/lib/postgresql/9.1/bin/pg_ctl start -D /var/lib/postgresql/9.1/main -l /var/log/postgresql/postgresql-9.1-main.log -s -o -c config_file="/etc/postgresql/9.1/main/postgresql.conf"directly, it fails with:

/usr/lib/postgresql/9.1/bin/pg_ctl: symbol lookup error: /usr/lib/postgresql/9.1/bin/pg_ctl: undefined symbol: PQping

Here is my system information:

$ uname -a
Linux daclin 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Would you have any idea on what is going on?

4
  • How did you installed it?
    – Braiam
    Dec 17, 2013 at 18:23
  • check your "data_directory" and make sure that directory is owned by user postgres
    – Rinzwind
    Dec 17, 2013 at 18:38
  • I installed it with apt-get install postgresql-9.1
    – Such
    Dec 18, 2013 at 9:19
  • The data directory is owned by user postgres, group postgres
    – Such
    Dec 18, 2013 at 9:20

2 Answers 2

1

I had that same setback myself too. This approach was the one that I used that solved the issue on my end:

We are removing the apt of postgresql that was from the repository.

sudo apt-get remove -y --purge postgresql*

We then are making source list to download Postgre directly from the company.

sudo touch /etc/apt/sources.list.d/pgdg.list
sudo nano /etc/apt/sources.list.d/pgdg.list

and add this line to pgdg.list for 12.04 or 12.10:

deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main

for 13.04 or 13.10

deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main

Then ctrl-x as to save the pgdg.list and finally to get out back to command line.
We then grab keys to use this deb package:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
sudo apt-key add -
sudo apt-get update

Then it'll install the postgresql-9.3.

1
  • Thanks for you help! I had tried that actually (and I retried) but the output was exactly the same.
    – Such
    Dec 18, 2013 at 9:21
1

OK, I finally found the issue. There was a conflict with libpq.so. It was actually installed twice.

Running ldconfig -v | grep libpq showed:

libpq.so.5 -> libpq.so.5.1
libpq.so.5 -> libpq.so.5.6

I removed the first one and it works like a charm now. The issue was really specific to my setup but it might be helpful anyway...

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .