Subject: PostgreSQL ‘initdb’ fails to find‘locale’ program

From: Ludovic Courtès <[email-masked]>
Date: Fri, 05 Jul 2024 23:22:40 +0200

PostgreSQL initialization tries to invoke the ‘locale’ program and
fails:

--8<---------------cut here---------------start------------->8---
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... sysv
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Europe/Oslo
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... sh: line 1: locale: command not found
2024-07-05 23:20:32.321 CEST [96] WARNING:  no usable system locales were found
ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /gnu/store/2yj5sbnqdhxpn47cd2gzi9s8gvl35h9y-postgresql-13.12/bin/pg_ctl -D /var/lib/postgresqt

--8<---------------cut here---------------end--------------->8---

Ludo’.