When I was redeploying my IntoVPS Server and upgrading to the newest version of Ubuntu Server, I came across a number of issues with locales not being configured correctly. The error usually looks something like this:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
You’re getting this error because no locales have been configured. To fix it, firstly ensure that you have the locales package installed:
$ apt-get install locales
If locales is not installed, you will get a screen which will ask you which locales you wish to enable. If locales is already installed, then type the following to commands to regenerate locales.
$ locale-gen en_US en_US.UTF-8 en_AU en_AU.UTF-8
$ dpkg-reconfigure locales
If you want to use other locales, you can re-run the locale-gen and dpkg-reconfigure locales commands.