-
-
Save opsxcq/6f80d13554676b3bd701006d8e6c9fcd to your computer and use it in GitHub Desktop.
Fix locale error on Debian Wheezy/Jessie (perl: warning: Setting locale failed)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you got this error running apt-get or some other program: | |
perl: warning: Setting locale failed. | |
perl: warning: Please check that your locale settings: | |
Just run this code: | |
export LANGUAGE=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
export LC_ALL=en_US.UTF-8 | |
locale-gen en_US.UTF-8 | |
dpkg-reconfigure locales |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For the record, that last one doesn't survive a reboot, but this one does.
echo "locales locales/default_environment_locale select en_US.UTF-8" | debconf-set-selections
echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8" | debconf-set-selections
rm -rf "/etc/locale.gen"
dpkg-reconfigure --frontend noninteractive locales &> /dev/null
echo "Locale for the target host was set to en_US.UTF-8 UTF-8."
I put that in a sh script and it runs nicely as root.