Ubuntu: 시스템 문자코드를 설정/재설정 하는 방법

ubuntu
linux

#1

Ubuntu에서 시스템 문자 코드를 설정/재설정

  • OS: Ubuntu 14.04.x, 16.04.x 등 서버환경
  • 기본 영문으로 설치했을 때 우리말 지원을 위한 환경 설정/재설정하는 방법

시스템 문자 코드를 설정/재설정 과정

  • $LANG 로 현재 사용중인 문자 코드를 알아봅니다.
[email protected]:~# echo $LANG
en_US.UTF-8
  • 우리말 언어팩을 apt-get 을 이용해서 설치합니다.
[email protected]:~# apt-get -y install language-pack-ko-base language-pack-ko
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  language-pack-ko language-pack-ko-base
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 923 kB of archives.
After this operation, 3,944 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main language-pack-ko-base all 1:14.04+20160720 [921 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main language-pack-ko all 1:14.04+20160720 [1,818 B]
Fetched 923 kB in 1s (875 kB/s)         
Selecting previously unselected package language-pack-ko-base.
(Reading database ... 86318 files and directories currently installed.)
Preparing to unpack .../language-pack-ko-base_1%3a14.04+20160720_all.deb ...
Unpacking language-pack-ko-base (1:14.04+20160720) ...
Selecting previously unselected package language-pack-ko.
Preparing to unpack .../language-pack-ko_1%3a14.04+20160720_all.deb ...
Unpacking language-pack-ko (1:14.04+20160720) ...
Setting up language-pack-ko (1:14.04+20160720) ...
Setting up language-pack-ko-base (1:14.04+20160720) ...
Generating locales...
  ko_KR.UTF-8... done
Generation complete.
  • 지역설정을 갱신합니다.
[email protected]:~# update-locale LANG=ko_KR.UTF-8 LANGUAGE="ko_KR:ko"
  • bash 쉘에 지역설정을 설정/재설정합니다.
[email protected]:~# source /etc/default/locale
  • 올바르게 언어 설정/재설정이 되었는지 확인합니다.
[email protected]:~# echo $LANG
ko_KR.UTF-8