How to solve the "WARNING! Your environment specifies an invalid locale" Error

On logging into a remote server, I got an error that began with: WARNING! Your environment specifies an invalid locale.. This is how I fixed it:

I entered each one of these commands in the terminal. The last one reboots the server.

locale
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
sudo dpkg-reconfigure locales
sudo shutdown -r 0

Read more here.

Comments

Let us know your comments by tweeting to @codeselfstudy or emailing [email protected].
(The commenting system here is offline for the moment but will return soon. This blog is still under construction.)

Return to the Code Self Study Blog.