Tip for setting user locale on CentOS

Every time is ssh into my vm running CentOS I get :

bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

which was very irritating because the terminal could not understand anything but system commands.

The solution : 

  • Create environment file
    • vi /etc/environment
  • Paste
    • LANG=en_US.utf-8
    • LC_ALL=en_US.utf-8
  • Save

You will need to logoff for the setting to take effect !!!