Skip to content

Instantly share code, notes, and snippets.

@budiantoip
Last active October 19, 2022 12:56
Show Gist options
  • Save budiantoip/7ed512f53370ae5952063a052605be7f to your computer and use it in GitHub Desktop.
Save budiantoip/7ed512f53370ae5952063a052605be7f to your computer and use it in GitHub Desktop.
Generate Locale

Display the Current Settings

locale

Display the Available Locales

locale -a

Ubuntu

Reference :

Generate new locale

locale-gen en_US.UTF-8

Check existing locale configuration

cat /etc/default/locale

Change an existing locale

update-locale LANG=en_US.utf8

Other workaround

export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LANGUAGE="en_US.UTF-8"

CentOS

Generate new locale en_US.UTF-8

localedef -v -c -i en_US -f UTF-8 en_US.UTF-8

Change an existing locale

localectl set-locale LC_ALL=en_US.UTF-8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment