Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was trying to install Postgres 9.1.4 on Fedora 17 using Yum. If I do:

sudo yum install postgres-libs
sudo yum install postgres
sudo yum install postgis

All the installs appear to complete successfully (i.e., no errors), but I cannot start the Postgres daemon using:

service postgresql initdb

Like the official Postgres download guide says to do (http://www.postgresql.org/download/linux/redhat/). The error says Unknown operation initdb.

RPM tells me that it installed psql to /usr/bin/, which I confirmed. It turns out that only a few components installed correctly (psql, pg_dump, pg_configure, and a few others), but most are missing (e.g., pg_ctl and postgres).

I've tried several different configurations and had several of my coworkers (with more linux experience than me) look at it, but so far nothing has worked. Two of them have also run into similar issues installing Postgres using apt-get on Ubuntu, which makes me think the rpm isn't doing its job. It seems the only solution to build it from source, which is more robust anyway, but of course it takes longer.

I'm wondering, though, if anyone else has run into this issue and/or has successfully installed Postgres on either Fedora or Ubuntu using a package manager like yum or apt-get? Is the rpm broken?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The service postgresql initdb command does not work because now service just calls systemd, and all of these random helper functions are gone. As documented here, you now need to do:

sudo postgresql-setup initdb

to accomplish the same thing.

The rest of your mystery is also simple: you're missing the postgresql-server package.

sudo yum install postgresql-server

And then you'll have /usr/bin/pg_ctl and /usr/bin/postgres. Running yum search postgres is a helpful way to look for clues, but you can also do sudo yum install /usr/bin/pg_ctl or similar, and yum will figure out what package provides the missing file.

share|improve this answer
    
Thanks! I think that would do the trick, since Yum did not install the postgresql-server package automatically. I ended up giving Fedora the boot and installing Arch anyway, and suddenly life got a lot better. Pacman handles everything nicely with sudo pacman -S postgres. –  Sean the Bean Sep 3 '12 at 16:13

Your Answer

 
discard

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.