1

I just got a new VPS running Ubuntu 14.04 which I want to use as PostgreSQL server.

I followed this guide but for some reason it won't work as described: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-14-04

So I installed PGSQL using

sudo apt-get update
sudo apt-get install postgresql postgresql-contrib

It seems like everything was installed but the initial setup failed because the server does not run. If I try to start the server it says

$ service postgresql start
* No PostgreSQL clusters exist; see "man pg_createcluster"

I googled the problem and found this in the guides comments:

I solved it, you need to set the locale before you install postgres otherwise it won't create the cluster for you, if you pay attention to the error messages at the install you can figure it out.

Adding that info to the tutorial would be great.

So I tried to uninstall the mess using:

sudo apt-get --purge remove postgresql postgresql-contrib
sudo locale-gen enUS.UTF-8
sudo apt-get install postgresql postgresql-contrib

But its still the same issue. Also it feels like the second installation after I uninstalled it was way shorter than the first installation, why does this happen?

Do I have to reinstall Ubuntu to get it work or are there other ways to get this fixed?

5
  • There's a typo in your locale-gen command. The locale should be called en_US.UTF-8, but the comment system of the tutorial seems to swallow the underscore. Apr 5, 2015 at 22:33
  • Yes, I saw this message but it seems like this shouldn't be the regular route to go. I tried "pg_createcluster 1.0 main" and "pg_createcluster 9.4 main" but for both of them it can't find any initdb program. I'd prefer the cluster which should be created with the installation
    – kuhro
    Apr 5, 2015 at 22:35
  • Here is what the installation / uninstallation process looks like maybe there is already an issue: uninstall install
    – kuhro
    Apr 5, 2015 at 22:41
  • Did you actually install any PostgreSQL server packages? apt-get install postgresql-9.4 or apt-get install postgresql-9.3 for example? See help.ubuntu.com/community/PostgreSQL and apt.postgresql.org Apr 6, 2015 at 4:44
  • Awesome, your comment led me to the solution! I found this quickstart guide wiki.postgresql.org/wiki/Apt#Quickstart ran the shell script and reinstalled PostgreSQL, now it runs and created the cluster by itself. Thank you!
    – kuhro
    Apr 6, 2015 at 12:16

0

You must log in to answer this question.

Browse other questions tagged .