Browse Source

fix: [docker-host] catch common debian mis-usage that prevents ``locale-gen`` to be used

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
pull/19/head
Valentin Lab 3 years ago
parent
commit
dfc8198ecb
  1. 7
      precise/base-0k/hooks/install.d/00-base.sh

7
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 apt-get install -y language-pack-en </dev/null
;; ;;
Debian) Debian)
if ! type -p locale-gen >/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 sed -ri 's/^\s*#\s*(en_US\.UTF-?8.*)\s*$/\1/g' /etc/locale.gen
locale-gen locale-gen
;; ;;

Loading…
Cancel
Save