7

I am on Unix. I have got postgresql-9.3 installed.
When I want to start the server using pg_ctl or postgres, the terminal gives me:

The program 'postgres' is currently not installed. You can install it by typing:
sudo apt-get install postgres-xc

Can't I start the server without this postgres-xc?

Erwin Brandstetter
  • 605,456
  • 145
  • 1,078
  • 1,228
Hello lad
  • 17,344
  • 46
  • 127
  • 200

4 Answers4

4

This must be remnants of the postgres-xc package you had installed previously.

Since you just installed postgresql-9.3 and don't seem to have any databases in use, yet, I suggest to completely purge all postgres packages.

sudo apt-get purge postgresql-9.2
sudo apt-get purge postgresql-xc
...

Until there's nothing left:

dpkg -l | grep postgres

Then start from scratch. Your instance of pg_ctl seems to belong to the package postgres-xc. This should be gone after you've uninstalled the package. Find out with one of these commands:

dpkg -S pg_ctl
dlocate pg_ctl
apt-file search pg_ctl

pg_ctlcluster is provided by the package postgresql-common.
pg_ctl is provided by the package postgresql-9.3.

More about starting Postgres in the manual.

Erwin Brandstetter
  • 605,456
  • 145
  • 1,078
  • 1,228
  • on a rather confused Server your command dpkg -l | grep postgres helps plenty to see what Ubuntu thinks it has installed. +1 – Adesso Feb 07 '17 at 07:49
0

It is possible you might be missing a few things.

Try: sudo apt-get install postgresql-client and sudo apt-get install postgresql postgresql-contrib

The message about installing xc is a dud, it's probably suggesting that based on what it scanned inside the xc repositories.

Here's a good reference to this problem and its solution: https://dba.stackexchange.com/questions/72580/missing-the-pg-ctl-package-in-postgres-9-3-installation

Community
  • 1
  • 1
ahron
  • 803
  • 6
  • 29
0

Due to reasons a normal install of postgres will not place the postgres binary file in the path.

Adding the right directory to the path solves the problem (temporarily).

PATH=/usr/lib/postgresql/9.3/bin:$PATH

To make it permanent on my Ubuntu machine I added the line to /etc/environment this makes it work for all users.

The correct way to set the PATH is different for different systems, for more info see see:

How to permanently set $PATH on Linux?

Community
  • 1
  • 1
JKAbrams
  • 215
  • 3
  • 11
0

You must install postgresql-client:

sudo install postgresql-client

Try to enter this command to the console:

sudo -u postgres psql

artamonovdev
  • 2,260
  • 1
  • 29
  • 33