Write-up of how I installed PostgreSQL 14 on Ubuntu 20.04 after its December 2025 EOL


In early February 2026 I manage to install PostgreSQL 14 (this was the highest version I have successfully installed on that machine) on my Ubuntu 20.04 system that had already entered EOL since December 2025.

I started off with a DeepSeek conversation (also archived here). Eventually that run into some problems although it did point me towards the right direction.

Eventually I discovered this Medium article which I've also archived here in various formats (because of a popup that obscures a little more than a line parts in any given format):

After following the Medium article I was able to get PostgreSQL. Subsequently, I verified that it has its own user and group:

$ sudo cut -d: -f1 /etc/passwd | xargs groups | grep -i postgres
postgres : postgres ssl-cert
… and that the PostgreSQL server is indeed running
$ sudo systemctl status postgresql@14-main
● postgresql@14-main.service - PostgreSQL Cluster 14-main
     Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled-runtime; vendor preset: enabl>
     Active: active (running) since Tue 2026-02-03 14:34:08 EET; 50min ago
$ #
$ # rest of output ommitted
$ #
$
… and has the expected version:
$ sudo -u postgres psql -c "SELECT version();"
mperdikeas@mp-ThinkStation-P320:~/repos/prj/mperdikeas.github.com#
$ sudo -u postgres psql -c "SELECT version();"
                                                               version                                                               
-------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 14.18 (Ubuntu 14.18-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0, 64-bit
(1 row)
… and the port it listens to:
$ sudo ss -tlnp | grep -i postgres
LISTEN    0         244              127.0.0.1:5432             0.0.0.0:*        users:(("postgres",pid=1115709,fd=5))

I was also able to find the location of the configuration file and the data directory:

$ sudo -u postgres psql postgres
[sudo] password for mperdikeas: 
psql (14.18 (Ubuntu 14.18-1.pgdg20.04+1))
Type "help" for help.

postgres=# show config_file;
               config_file               
-----------------------------------------
 /etc/postgresql/14/main/postgresql.conf
(1 row)

postgres=# show data_directory;
       data_directory        
-----------------------------
 /var/lib/postgresql/14/main
(1 row)

postgres=# 

After that, I went back to the DeepSeek discussion (linked above) and asked a number of questions regarding Unit files in /lib/systemd/system and how to properly cleanup some leftover files from a previous PostgreSQL 12 installation. You can find details on all the above towards the end of the DeepSeek conversation.

After clearing up a number of scripts and stale links from a previous PostgreSQL 12 installation, I inquired, in the context of the same DeepSeek discussion how to install all PostGIS extensions for PostgreSQL 14 and indeed installed them using:

$ sudo apt install postgresql-14-postgis-3-scripts -y
(before that I had verified independently that, indeed, PostGIS 3 is the version to install with PostgreSQL 14).

The above succeeded and allowed me to install the following extensions from inside psql for on some database I was interested in:

CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_raster;
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS postgres_fdw;

Following the above I installed:

sudo apt install postgresql-14-pgaudit -y

I then went ahead and did the necessary configurations as instructed in the linked DeepSeek discussion (see there). The reason being that in contract to PostGIS, pgaudit requires additional configuration. However, before doing that I created a git repo (owned by root) in /etc/postgresql/14/main/ to keep track of all modifications to PostgreSQL configuration files.

Following the modification of the /etc/postgresql/14/main/postgresql.conf file and the restart of PostgreSQL (as advised in the linked DeepSeek conversation) I was indeed able to connect using psql to my database and execute the below:

CREATE EXTENSION IF NOT EXISTS pgaudit;