From f3a9a9f67ce4f5c57bdd4d6dbd31d56d03ecb3e5 Mon Sep 17 00:00:00 2001 From: Roland Date: Wed, 22 Jul 2026 18:41:59 -0600 Subject: [PATCH] install: run install in a neutral C.UTF-8 locale Fresh installs (and SSH sessions that forward LC_* variables from the client) can reference an ungenerated locale, causing apt/perl/python to emit "Cannot set LC_CTYPE to default locale" warnings throughout the install log. Export LC_ALL=C.UTF-8 for the install run. C.UTF-8 is built into glibc, always present, and locale-neutral, so it silences the warnings without generating a locale, without adding a dependency, and without changing the user's configured locale (e.g. an en_GB.UTF-8 system stays en_GB.UTF-8). Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/install_debian_12.sh | 7 +++++++ scripts/install_raspberrypios.sh | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/scripts/install_debian_12.sh b/scripts/install_debian_12.sh index 96824ba8..7ae2f5ec 100755 --- a/scripts/install_debian_12.sh +++ b/scripts/install_debian_12.sh @@ -4,6 +4,13 @@ echo "Debian 12 install start: $(date '+%Y-%m-%d %H:%M:%S')" set -x set -e +# Run the install in a predictable UTF-8 locale. Fresh images (or SSH sessions +# forwarding LC_* variables from the client) may reference an ungenerated +# locale, which makes apt/perl/python emit "Cannot set LC_CTYPE" warnings +# throughout the install. C.UTF-8 is built into glibc, always present, and +# locale-neutral, so this does not change the user's configured locale. +export LC_ALL=C.UTF-8 + # Update if we haven't updated in the last day. [ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -1)" ] && apt update # Install dependencies. diff --git a/scripts/install_raspberrypios.sh b/scripts/install_raspberrypios.sh index ee122ca4..0c7e2ece 100755 --- a/scripts/install_raspberrypios.sh +++ b/scripts/install_raspberrypios.sh @@ -4,6 +4,13 @@ echo "Raspberry Pi OS install start: $(date '+%Y-%m-%d %H:%M:%S')" set -x set -e +# Run the install in a predictable UTF-8 locale. Fresh images (or SSH sessions +# forwarding LC_* variables from the client) may reference an ungenerated +# locale, which makes apt/perl/python emit "Cannot set LC_CTYPE" warnings +# throughout the install. C.UTF-8 is built into glibc, always present, and +# locale-neutral, so this does not change the user's configured locale. +export LC_ALL=C.UTF-8 + # Update if we haven't updated in the last day. [ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mtime -1)" ] && apt update # Install dependencies.