Guides 11792 Published by

The article walks through getting PostgreSQL 14 on Fedora 36 without wrestling with older packages or compiling from source. First it shows how to add the official PGDG repository, then disable Fedora’s built‑in postgresql module so that the newer binaries win. Next you install the server package, run the initdb script to set up the data directory, and enable the service to start automatically on boot. Finally it offers a quick test with psql, tips for avoiding libpq conflicts, and reminders to keep the server updated while preserving the chosen version.



How to Install PostgreSQL 14 on Fedora 36 (No More Broken Packages)

If you’re on Fedora 36 and need the fresh, stable 14‑series database, you can get it in three clean steps—no extra repos, no tangled dependencies, just a working cluster ready for your apps. No need to wrestle with EPEL or manual compilation.

Why the Official PostgreSQL Repo is Your Friend

Fedora’s default dnf repositories ship a slightly older 13‑series build (unless you’re on Fedora 38). Pulling that version into a newer OS can cause subtle incompatibilities, especially if your application expects the new JSONB enhancements or the updated authentication methods in 14. The PostgreSQL Global Development Group keeps an up‑to‑date repo for each major release; it’s safer than poking around with RPMs from other sources.

Step 1: Add the PostgreSQL 14 Repository
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-8.5-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Why this matters: The RPM installs a repo file under /etc/yum.repos.d/. That tells dnf exactly where to pull the 14 binaries from, and it overrides the older version that might otherwise sneak in. I’ve seen Fedora users get stuck trying to upgrade from 13 to 14 while the wrong repo is still enabled—don’t let that happen.

Step 2: Disable the Built‑in PostgreSQL Module

Fedora bundles a “module” called postgresql that can shadow your new install.

sudo dnf -qy module disable postgresql

Why this matters: Modules are Fedora’s way of providing multiple versions side‑by‑side, but they also come with their own default packages. If you skip disabling, the system will try to pull its own PostgreSQL 13 and you’ll end up with a half‑working cluster that can’t find the correct postgres binary.

Step 3: Install PostgreSQL 14
sudo dnf install -y postgresql-server

Why this matters: Installing just the server package pulls in everything needed—libraries, client tools, and the init script. Once installed, the cluster isn’t initialized yet; that’s what we do next.

Step 4: Initialize the Database Cluster
sudo /usr/pgsql-14/bin/postgresql-14-setup initdb

Why this matters: The initdb step writes the initial configuration files and data directory (/var/lib/pgsql/14/data). If you skip it, systemctl start postgresql-14 will fail with a “data directory not found” error. I remember my first attempt; I forgot to initdb after a clean install and spent 15 minutes chasing a cryptic startup failure.

Step 5: Enable & Start the Service
sudo systemctl enable --now postgresql-14

Why this matters: Enabling ensures PostgreSQL starts on boot, while --now starts it immediately. Check that it’s running:

systemctl status postgresql-14 | grep Active

You should see “active (running)”.

Verify the Version
psql --version
# or
/usr/pgsql-14/bin/psql -c "SELECT version();"

Both commands should output 14.x. If you still see an older number, double‑check that your $PATH points to /usr/pgsql-14/bin.

Common Pitfall: The “libpq” Conflict

If you have the older postgresql-libs package installed from Fedora’s default repo, it can conflict with the 14 libraries and cause runtime errors. Remove or downgrade those packages:

sudo dnf remove postgresql-libs

That keeps your environment tidy and avoids “library version mismatch” warnings when other apps try to connect.

Quick Test: Create a Sample Database
sudo -u postgres psql
CREATE DATABASE testdb;
\c testdb
SELECT 1+1;
\q

If you get 2 back, congratulations—you’re good to go. If not, re‑check the service status or look for stray postgresql-13 processes that might still be running.

And there it is: a clean PostgreSQL 14 install on Fedora 36 without extra fuss. Keep your system updated with:

sudo dnf update -y postgresql-server

That pulls in security patches while leaving the version untouched unless you decide to upgrade deliberately.