warning: Setting locale failed. Raspbian [SOLVED]
The warning message in the title appears during the installation of packages (invoking Perl) and it’s due to missing locales being set not. The full message looks like the following one:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").
locale: Cannot set LC_ALL to default locale: No such file or directory
To fix this warning I had to issue the following few commands:
pi@raspberrypi:~$ sudo -s
pi@raspberrypi:~$ export LANGUAGE=en_US.UTF-8
pi@raspberrypi:~$ export LANG=en_US.UTF-8
pi@raspberrypi:~$ export LC_ALL=en_US.UTF-8
pi@raspberrypi:~$ locale-gen en_US.UTF-8
pi@raspberrypi:~$ dpkg-reconfigure locales
as soon as I run the last I was asked to choose the locale to generate. My choice was en_US-UTF.8
That’s all, the annoying message disappear!