From b82369c2415dc8fb05c95ba0f1975788b9c143ef Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Wed, 15 Oct 2025 11:42:24 +0200 Subject: [PATCH] systemvm: fix duplicated "en_US.UTF-8 UTF-8" in /etc/locale.gen (#11823) --- tools/appliance/systemvmtemplate/scripts/configure_locale.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/appliance/systemvmtemplate/scripts/configure_locale.sh b/tools/appliance/systemvmtemplate/scripts/configure_locale.sh index 8db7e4e5598..f5477506cfd 100644 --- a/tools/appliance/systemvmtemplate/scripts/configure_locale.sh +++ b/tools/appliance/systemvmtemplate/scripts/configure_locale.sh @@ -22,13 +22,15 @@ set -x function configure_locale() { grep LANG=en_US.UTF-8 /etc/default/locale && \ grep LC_ALL=en_US.UTF-8 /etc/default/locale && \ - grep "en_US.UTF-8 UTF-8" /etc/locale.gen && + grep "^en_US.UTF-8 UTF-8" /etc/locale.gen && return cat >> /etc/default/locale << EOF LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 EOF + + grep "^en_US.UTF-8 UTF-8" /etc/locale.gen || \ cat >> /etc/locale.gen << EOF en_US.UTF-8 UTF-8 EOF