Setup Locales in Linux Server

Gao

When I deploy servers in linux, some issue occurs. It said locales is not set correctly.

Here is How I set locales

Locale Setup

apt-get update apt-get install -y locales locale-gen en_US.UTF-8

List supported locales

locale -a

Set current locale

update-locale LANG=en_US.UTF-8

Other Way

Or on ubuntu server, it can be easily by run this command in a interactive shell.

dpkg-reconfigure locales # this will open a interactive terminal windown to configure