From dfc8198ecb3f77db671d56bece0835fe33f427fb Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Wed, 12 Jan 2022 00:09:39 +0100 Subject: [PATCH] fix: [docker-host] catch common debian mis-usage that prevents ``locale-gen`` to be used Signed-off-by: Valentin Lab --- precise/base-0k/hooks/install.d/00-base.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/precise/base-0k/hooks/install.d/00-base.sh b/precise/base-0k/hooks/install.d/00-base.sh index 8446daa..d0eff0e 100755 --- a/precise/base-0k/hooks/install.d/00-base.sh +++ b/precise/base-0k/hooks/install.d/00-base.sh @@ -47,6 +47,13 @@ case $(lsb_release -is) in apt-get install -y language-pack-en /dev/null && [ -x /usr/sbin/locale-gen ]; then + echo "Your shell is incorrectly set as your PATH doesn't contain '/usr/sbin'." >&2 + echo "This probably happens because you've incorrectly entered root environment" >&2 + echo "Please use 'sudo -i' or 'su -' to enter a root shell from another user." >&2 + echo " ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918754" + exit 1 + fi sed -ri 's/^\s*#\s*(en_US\.UTF-?8.*)\s*$/\1/g' /etc/locale.gen locale-gen ;;