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?

GooDeeJAY
  • 1,681
  • 2
  • 20
  • 27

1 Answers1

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
TJ Zimmerman
  • 3,100
  • 25
  • 39