[FIX] script install: Fedora postgres initdb (locale) + dev group id

Tested make install_os on a real Fedora 42 VM (exit 0: gcc 15, psql,
node 22 installed). Two fixes from the run:

- postgresql-setup --initdb failed with "invalid locale settings"
  because Fedora cloud images ship no LANG; force a valid locale via
  PGSETUP_INITDB_OPTIONS=--locale=C.UTF-8 and wipe a partial data dir
  first (a failed init leaves /var/lib/pgsql/data/log behind and blocks
  the retry). Verified: cluster PG 16 initialised, service active,
  erplibre superuser created.
- the dev-tools group was referenced by display name ("C Development
  Tools and Libraries", "No match"); use the group id c-development.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mathieu Benoit 2026-07-28 05:17:40 +00:00
parent 84e383a3b1
commit 7def76eb62

View file

@ -18,7 +18,8 @@ DNF="sudo dnf install -y --refresh --skip-unavailable"
# Outils de compilation (build Python via pyenv, extensions Python)
#--------------------------------------------------
echo -e "\n---- Groupe outils de développement ----"
sudo dnf group install -y --skip-unavailable development-tools "C Development Tools and Libraries" \
# Groupes par ID (le nom affiché « C Development Tools... » n'est pas matché).
sudo dnf group install -y --skip-unavailable development-tools c-development \
|| sudo dnf install -y gcc gcc-c++ make automake patch
#--------------------------------------------------
@ -34,7 +35,11 @@ fi
# Initialisation du cluster (Fedora ne le fait pas automatiquement).
if [ ! -f /var/lib/pgsql/data/PG_VERSION ]; then
echo -e "\n---- Initialisation du cluster PostgreSQL ----"
sudo postgresql-setup --initdb || true
# Nettoie un init partiel et FORCE une locale valide : les images cloud
# Fedora n'ont pas de LANG défini -> « initdb: invalid locale settings ».
sudo rm -rf /var/lib/pgsql/data
sudo PGSETUP_INITDB_OPTIONS="--locale=C.UTF-8 --encoding=UTF8" \
postgresql-setup --initdb || true
fi
sudo systemctl enable --now postgresql 2>/dev/null || true
# PostGIS : optionnel (géospatial), ne bloque pas.