Skip to content

Instantly share code, notes, and snippets.

@budiantoip
Last active December 23, 2024 05: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"

Other workaround - 2

apt-get update &&
apt-get install -y language-pack-en-base &&
export LC_ALL=en_US.UTF-8 &&
export LANG=en_US.UTF-8 &&
apt-get install -y software-properties-common &&
add-apt-repository -y ppa:ondrej/php5-5.6 &&
add-apt-repository -y ppa:ondrej/mariadb-10.0 && 
apt-get update && 
apt-get -y upgrade

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