Locale issue in Linux VPS Box

In case of a new Linux VPS box it is possible that you might encounter an error like this:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = “UTF-8”,
LANG = “en_US.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).

To solve this error the following approach worked for me on my Debian box. Execute the following command

sudo vi /etc/ssh/sshd_config

In this file comment the following line. This line basically allows the client OS to pass it’s environment parameters to the remote server which can cause issues.

AcceptEnv LANG LC_*

Save the file and reboot the VPS box. After rebooting this error should not ideally come. If you are still getting this error then it is possible that you don’t have the locale installed. The following command might help you in resolving this problem.

sudo locale-gen
sudo dpkg-reconfigure locales

 

Leave a Reply

Your email address will not be published. Required fields are marked *