2

Installing PostgreSQL 12:

sudo dnf install @postgresql:12

Then, contrib package for additional features: sudo dnf install postgresql-contrib

Afterwards, when I try to initialize the PostgreSQL database:

sudo postgresql-setup initdb

I'm getting: sudo: postgresql-setup: command not found

Also, when I try to check the status:

 sudo systemctl status postgresql

Getting this error: Unit postgresql.service could not be found.

What I'm doing wrong? If this way of installing is wrong, is there another option to install postgresql on centos?

2
  • 3
    Did you follow all steps from postgresql.org/download/linux/redhat for CentOS 8 ? Make sure to follow exact steps from this link. Commented Mar 25, 2020 at 8:48
  • 1
    You need to install postgresql-server Commented Mar 25, 2020 at 12:07

1 Answer 1

2

You have only installed the PostgreSQL client application on your server. In order to install the server software, you need to install the postgresql-server package which will satisfy those package dependencies. Afterwards you can follow this documentation to continue provisioning, configuring, and maintaining your new database.

https://www.postgresql.org/download/linux/redhat/

This gist of which, as you originally mentioned, is simply:

  postgresql-setup initdb
  systemctl enable postgresql.service --now
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.