Fix locale error message on Ubuntu Linux Containers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
369 B

if (locale 2>&1 | grep "locale: Cannot set"); then
if ! [ "$(id -u)" -eq 0 ]; then
echo "Locales is broken, but you must be root to fix"
exit 1
echo "Fixing Locales"
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
update-locale LANG=en_US.UTF-8 UTF-8
dpkg-reconfigure --frontend=noninteractive locales