[PATCH v2 01/15] base_image: restore locales-all installation for Debian Trixie

Daniel Gomez <[email protected]> Wed, 29 Oct 2025 13:40:43 +0100
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
From: Daniel Gomez <[email protected]>

The virt-customize phase was failing with "update-locale: Error: invalid
locale settings" because commit 6bb3bfb2c257 removed the locales-all
package installation but left the locale configuration commands that
depend on it.

The update-locale command validates all settings in /etc/default/locale,
and without locales-all providing the necessary locale infrastructure, it
rejects the LANGUAGE=en_US:en setting as invalid during image build.

Restore the locales-all installation within the Debian Trixie conditional
block, placing it immediately before the locale configuration sequence so
the image has proper locale support from the start. This prevents SSH
locale warnings on first boot while keeping the package Debian-specific.

Generated-by: Claude AI
Signed-off-by: Daniel Gomez <[email protected]>
---
 playbooks/roles/base_image/templates/virt-builder.j2 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/playbooks/roles/base_image/templates/virt-builder.j2 b/playbooks/roles/base_image/templates/virt-builder.j2
index 3069e95f..289ee9e5 100644
--- a/playbooks/roles/base_image/templates/virt-builder.j2
+++ b/playbooks/roles/base_image/templates/virt-builder.j2
@@ -73,6 +73,7 @@ append-line /etc/nsswitch.conf:ethers:         db files
 append-line /etc/nsswitch.conf:rpc:            db files
 append-line /etc/nsswitch.conf:netgroup:       nis
 uninstall cloud-init
+install locales-all
 write /etc/default/locale:LANG=en_US.UTF-8
 append-line /etc/default/locale:LANGUAGE=en_US:en
 write /etc/locale.gen:en_US.UTF-8 UTF-8

-- 
2.51.0