Error when trying to get PostgreSQL going

hi - i’m trying to get PostgreSQL installed and running. i was able to get the yum repository for it installed. i keep getting error messages. i don’t really know what i’m doing wrong.

also getting the following errors:
“ERROR: Data directory /var/lib/pgsql/data is not empty!
ERROR: Initializing database failed, possibly see /var/lib/pgsql/initdb_postgresql.log”

i think these are out of order - the bottom one with just the red text is the first one that came up. i’m following instructions on
i tried following directions in the docs here on Fedora’s page, but got the same results. i’m trying to get SQL certified and would prefer to have this running on my computer instead of running a windows VM. any info would be appreciated.

p.s. - i’m running Fedora 38, just did updates, so everything is up to date. Linux 6.5.6-200.fc38.x86_64

Recommend you install the version of postgresql packaged for fedora and do not install a version packaged elsewhere.

As you see that version has issues.

Uninstall what you got from that non fedora repo and get rid od the .repo as well.

It would have been easier to install postgresql-server from the Fedora repository.
See for example

@vekruse @barryascott thanks for the info :+1: i will uninstall everything and try installing from the Fedora repository

still getting these errors:
ERROR: Data directory /var/lib/pgsql/data is not empty!
ERROR: Initializing database failed, possibly see /var/lib/pgsql/initdb_postgresql.log

i’ve followed the instructions step by step

As noted that is not the fedora recommended repo to use.

This message gives you the problem.

  1. The data directory is not empty. Take steps to see what is there and remove it. Postgresql will create that directory when it is installed so the directory should not even exist before starting the installation.
  2. The log should give details about what went wrong.
  3. What steps were followed and from where did you get those instructions. Steps in the link provided by @vekruse are very specific and should be followed meticulously. All those steps have worked for me in the past. In particular the initial installation and checks described in step 2 of the basic installation procedure are critical – including the verification of the ownership, permissions and selinux context.

@computersavvy @vekruse thank y’all for the information. i removed the data in the directory mentioned and reinstalled postgresql and now it seems to be good. thanks again :slight_smile: