From c0af70371659edc5201b627342e1362ee5b10197 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Mon, 27 Apr 2026 13:56:46 +0200 Subject: [PATCH] Set C.UTF-8 locale for apt-based containers Suppress perl/apt locale warnings by configuring C.UTF-8 for apt-based systems. The script now exports DEBIAN_FRONTEND=noninteractive and LC_ALL/LANG/LANGUAGE=C.UTF-8 when PKG_MANAGER==apt, and appends LC_ALL and LANG to /etc/environment if not present. This addresses cases where a container inherits an ungenerated host locale (e.g. Devuan) and ensures C.UTF-8, which is always available, is used. --- misc/install.func | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/misc/install.func b/misc/install.func index b3d8b62c..37f9f57f 100644 --- a/misc/install.func +++ b/misc/install.func @@ -878,6 +878,16 @@ setting_up_container() { # Remove Python EXTERNALLY-MANAGED restriction (Debian 12+, Ubuntu 23.04+) rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED 2>/dev/null || true + # Fix locale warnings from perl/apt (e.g. Devuan inherits host locale but hasn't generated it) + # C.UTF-8 is always available without locale-gen on any Linux system + if [[ "$PKG_MANAGER" == "apt" ]]; then + export DEBIAN_FRONTEND=noninteractive + export LC_ALL=C.UTF-8 + export LANG=C.UTF-8 + export LANGUAGE=C.UTF-8 + grep -qxF 'LC_ALL=C.UTF-8' /etc/environment 2>/dev/null || echo -e 'LC_ALL=C.UTF-8\nLANG=C.UTF-8' >>/etc/environment + fi + # Disable network wait services for faster boot case "$INIT_SYSTEM" in systemd)