Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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 start a PostgreSQL server (9.3) on Ubuntu 14.04. I am following this standard tutorial:

After updating to from 13.10 to 14.04 I purged the PostgreSQL installation because of a variety of difficulties I had inside pgadmin after the update.

Using this command after the fresh install:

    sudo -u postgres psql postgres


    sudo: unknown user: postgres
    sudo: rule-plugin could not be initialized

I couldn't find any solution to this, but I have to admit I only use postgresql to house my GIS-databases and I am pretty overwhelmed since encountering all these problems.


Output of ls -la /var/lib/postgresql is "Can't access /var/lib/postgresql: File or directory not found" (translated from German)

Edit 2 (purged and reinstalled):

    Paketlisten werden gelesen... Fertig
    Abhängigkeitsbaum wird aufgebaut.       
    Statusinformationen werden eingelesen.... Fertig
    Das folgende Paket wurde automatisch installiert und wird nicht mehr benötigt:
    Verwenden Sie »apt-get autoremove«, um es zu entfernen.
    Vorgeschlagene Pakete:
      oidentd ident-server locales-all
    Die folgenden NEUEN Pakete werden installiert:
    0 aktualisiert, 1 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
    Es müssen noch 0 B von 3.451 kB an Archiven heruntergeladen werden.
    Nach dieser Operation werden 17,5 MB Plattenplatz zusätzlich benutzt.
    Vormals nicht ausgewähltes Paket postgresql-9.3 wird gewählt.
    (Lese Datenbank ... 457272 Dateien und Verzeichnisse sind derzeit installiert.)
    Vorbereitung zum Entpacken von .../postgresql-9.3_9.3.4-1.pgdg14.04+1_amd64.deb ...
    Entpacken von postgresql-9.3 (9.3.4-1.pgdg14.04+1) ...
    Trigger für postgresql-common (154.pgdg14.04+1) werden verarbeitet ...
    Building PostgreSQL dictionaries from installed myspell/hunspell packages...
    Removing obsolete dictionary files:
    postgresql-9.3 (9.3.4-1.pgdg14.04+1) wird eingerichtet ...
    Use of uninitialized value $owneruid in getpwuid at /usr/bin/pg_createcluster line 277.
    Error: clusters must not be owned by root
    Error: could not create default cluster. Please create it manually with

      pg_createcluster 9.3 main --start

    or a similar command (see 'man pg_createcluster').
    update-alternatives: /usr/share/postgresql/9.3/man/man1/postmaster.1.gz wird verwendet, um /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) im Auto-Modus bereitzustellen
     * No PostgreSQL clusters exist; see "man pg_createcluster"
share|improve this question
What is the output of ls -la /var/lib/postgresql? – Salem May 9 '14 at 21:17
@salem - the directory is actually missing (see edit above). That is weird after a fresh install. – tobias47n9e May 9 '14 at 21:22
Weird... Can you remove it again (apt-get purge postgresql-9.3), install it and post the output of apt-get install postgresql-9.3 ? There may be any clue there. Also check if you can get any relevant information from /var/log/postgresql/postgresql-9.3-main.log. – Salem May 9 '14 at 21:29
@salem - the last few lines don't look good. – tobias47n9e May 9 '14 at 21:37
up vote 27 down vote accepted

NOTE: I am assuming you don't have any important data there or you have some backup of it. If that's not the case before doing anything you should create a backup of your data!

It seems that, for some reason, it is not creating the required user while installing. You can try to create it manually and see how it goes:

$ sudo useradd -U -s /bin/bash postgres

After that run the command apt suggested previously:

$ sudo pg_createcluster 9.3 main --start
share|improve this answer
It worked! I would give you 10 upvotes if I could!! ;) – tobias47n9e May 9 '14 at 22:12

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.