From 5f888e638692c3f084e042bedb127e10c891b499 Mon Sep 17 00:00:00 2001 From: dtoro Date: Fri, 10 Jul 2026 01:21:23 +0200 Subject: [PATCH] fix: set C.UTF-8 locale in provisioning script Fresh Debian LXCs have no locale configured, spamming "apt-listchanges: Can't set locale" / perl warnings across every install and breaking some packages' post-install scripts. Pin LANG/LC_ALL=C.UTF-8 (and hoist DEBIAN_FRONTEND) at the top of the in-container bootstrap. Co-Authored-By: Claude Opus 4.8 --- internal/httpapi/phase3.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/httpapi/phase3.go b/internal/httpapi/phase3.go index 3f77a54..c2f9a18 100644 --- a/internal/httpapi/phase3.go +++ b/internal/httpapi/phase3.go @@ -465,6 +465,9 @@ func executeApprovedAction(ctx context.Context, pool *db.Pool, execID uuid.UUID, func provisionScript(pkgs []string, postInstall string) string { var b strings.Builder b.WriteString("set -o pipefail\n") + // A fresh debian LXC has no locale set, which spams "Can't set locale" + // warnings and breaks some package post-install scripts. Pin C.UTF-8. + b.WriteString("export LANG=C.UTF-8 LC_ALL=C.UTF-8 DEBIAN_FRONTEND=noninteractive\n") b.WriteString("probe=deb.debian.org\n") b.WriteString("ok=0\n") b.WriteString("for i in $(seq 1 30); do if getent hosts \"$probe\" >/dev/null 2>&1; then ok=1; break; fi; sleep 2; done\n")