GooDeeJAY
GooDeeJAY

Reputation: 1820

Problem installing PostgreSQL 12 on CentOS 8

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?

Upvotes: 2

Views: 2705

Answers (1)

TJ Zimmerman
TJ Zimmerman

Reputation: 3484

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

Upvotes: 2

Related Questions