Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to install postgres on EC2 / EBS. I am following this article and stuck at the following step.

sudo su -
su postgres -
/usr/pgsql-9.0/bin/initdb -D /pgdata

I cant find the initdb command located at the stated location, matter of fact i cant find the pgsql* directory at all under /usr folder.

Was this changed for Postgres 9.2 or is there an alternate command that would help me initdb?

edit 1:

I know the folder pgsql-9.0 is version specific, so i was expecting to see more like pgsql-9.2 or similar.

share|improve this question

migrated from Dec 4 '12 at 4:11

This question came from our site for professional and enthusiast programmers.

I strongly advise you to use the Ubuntu packages for PostgreSQL. These create a cluster for you and start the database automatically using pg_wrapper. See – Craig Ringer Nov 20 '12 at 22:24
OP doesn't really mention if he's using packages or compiling from source. I'd hazard a guess he's already using packages and just doesn't know about the wrapper commands. Anyway, in my answer below I made the point that he should be using the various wrappers and what they're called. – Scott Marlowe Nov 21 '12 at 2:36
up vote 3 down vote accepted

I don't know about EC2/EBS but your title mentions Ubuntu. The linked article mentions yum and RPM which does NOT sound like Ubuntu (or even Debian-derived).

However, in Ubuntu the stuff is below /usr/lib/postgresql/<version>.

share|improve this answer
yes... those instructions aren't strictly for ubuntu, you are right. And thanks for the answer :) – thanikkal Nov 20 '12 at 19:35

For Ubuntu you want to use the debian / postgresql wrappers that start with pg_:


is what you're looking for. There's also

pg_lscluster pg_dropcluster pg_ctlcluster

just use man pages to look them up.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.