Set locale in Ubuntu

Ubuntu의 locale (언어) 설정 방법

1. Current locale

$ locale
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=

NOTE: locale 우선순위 LANG < LC_* < LC_ALL

2. Set locale (en_US.UTF-8)

$ sudo apt-get update
$ sudo apt-get install locales

# make locale
$ sudo locale-gen en.US.UTF-8
or
$ sudo dpkg-reconfigure locales
  select en_US.UTF-8 UTF-8
or
$ sudo localedef -i en_US -c -f UTF-8 en_US.UTF-8

# update locale
$ sudo update-locale LANG=en_US.UTF-8 LC_MESSAGES="en_US.UTF-8"
or
$ vim /etc/default/locale
  LANG=en_US.UTF-8
  LC_MESSAGES="en_US.UTF-8"
# LC_MESSAGES 변수는 시스템 메시지를 보여주는 언어에 대한 변수

then, reopen shell.

Updated: