CentOS6.3の日本語化

CentOSのログイン時に、日本語を設定してるのにキーボードの配置がおかしい。
[全角/半角]キーで[‘]、[Shift]+[2]で[@]と入力されて、[Shift]+[\]では[_]が表示されない。
早い話、キーボードが日本語106配置になってないようです。
おまけに日本語も入力できないので、キーボード配置の変更と日本語入力ができるように設定します。

■キーボードを日本語106に設定する
GNOMEパネルでシステム>設定>キーボードを開きます。
post339-01

レイアウトタブを開いたら、[追加]をクリックします。
post339-02

国をクリックしたら、選択項目を下へスクロールして日本を選択します。
post339-03

[追加]をクリックします。
post339-04

日本語をデフォルトに選択して[閉じる]をクリックします。
post339-05

端末を開いたら管理者権限に切り替えてkeyboardファイルを開いて、KEYTABLEとLAYOUTを書き換えます。
# vim /etc/sysconfig/keyboard

KEYTABLE=jp106"
MODEL="pc105+inet"
LAYOUT="jp"
KEYBOARDTYPE="pc"

■日本語フォントのインストール

日本語フォントをインストールします。
# yum -y groupinstall “Japanese Support”

# yum -y groupinstall "Japanse Support"
Loaded plugins: fastestmirror, refresh-packagekit, security
base                                                     | 3.7 kB     00:00
base/primary_db                                          | 4.5 MB     00:02
extras                                                   | 3.0 kB     00:00
extras/primary_db                                        | 6.3 kB     00:00
updates                                                  | 3.5 kB     00:00
updates/primary_db                                       | 2.5 MB     00:00
Setting up Group Process
Determining fastest mirrors
 * base: ftp.nara.wide.ad.jp
 * extras: ftp.nara.wide.ad.jp
 * updates: ftp.nara.wide.ad.jp
base/group_gz                                            | 211 kB     00:00
Warning: Group Japanse Support does not exist.
No packages in any requested group available to install or update
[root@localhost webmaster]# yum -y groupinstall "Japanese Support"
Loaded plugins: fastestmirror, refresh-packagekit, security
Existing lock /var/run/yum.pid: another copy is running as pid 16480.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  46 M RSS (357 MB VSZ)
    Started: Sun Sep 23 08:01:38 2012 - 00:07 ago
    State  : Sleeping, pid: 16480
Loading mirror speeds from cached hostfile
 * base: ftp.nara.wide.ad.jp
 * extras: ftp.nara.wide.ad.jp
 * updates: ftp.nara.wide.ad.jp
Setting up Group Process
Checking for new repos for mirrors
Package vlgothic-fonts-20091202-2.el6.noarch already installed and latest version
Package poppler-data-0.4.0-1.el6.noarch already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package ibus-anthy.x86_64 0:1.2.1-3.el6 will be installed
--> Processing Dependency: ibus >= 1.2.0.20100111 for package: ibus-anthy-1.2.1-3.el6.x86_64
--> Processing Dependency: kasumi for package: ibus-anthy-1.2.1-3.el6.x86_64
--> Processing Dependency: anthy for package: ibus-anthy-1.2.1-3.el6.x86_64
--> Processing Dependency: libanthydic.so.0()(64bit) for package: ibus-anthy-1.2.1-3.el6.x86_64
--> Processing Dependency: libanthy.so.0()(64bit) for package: ibus-anthy-1.2.1-3.el6.x86_64
---> Package ipa-gothic-fonts.noarch 0:003.02-4.2.el6 will be installed
---> Package ipa-mincho-fonts.noarch 0:003.02-3.1.el6 will be installed
---> Package ipa-pgothic-fonts.noarch 0:003.02-4.1.el6 will be installed
---> Package ipa-pmincho-fonts.noarch 0:003.02-3.1.el6 will be installed
---> Package man-pages-ja.noarch 0:20100115-5.el6 will be installed
---> Package vlgothic-p-fonts.noarch 0:20091202-2.el6 will be installed
--> Running transaction check
---> Package anthy.x86_64 0:9100h-10.1.el6 will be installed
---> Package ibus.x86_64 0:1.3.4-6.el6 will be installed
--> Processing Dependency: ibus-libs = 1.3.4-6.el6 for package: ibus-1.3.4-6.el6.x86_64
--> Processing Dependency: ibus-gtk = 1.3.4-6.el6 for package: ibus-1.3.4-6.el6.x86_64
--> Processing Dependency: im-chooser >= 1.2.5 for package: ibus-1.3.4-6.el6.x86_64
--> Processing Dependency: pyxdg for package: ibus-1.3.4-6.el6.x86_64
--> Processing Dependency: libibus.so.2()(64bit) for package: ibus-1.3.4-6.el6.x86_64
---> Package kasumi.x86_64 0:2.5-1.1.el6 will be installed
--> Running transaction check
---> Package ibus-gtk.x86_64 0:1.3.4-6.el6 will be installed
---> Package ibus-libs.x86_64 0:1.3.4-6.el6 will be installed
---> Package im-chooser.x86_64 0:1.3.1-3.el6 will be installed
--> Processing Dependency: imsettings >= 0.106.0 for package: im-chooser-1.3.1-3.el6.x86_64
--> Processing Dependency: libimsettings.so.4()(64bit) for package: im-chooser-1.3.1-3.el6.x86_64
---> Package pyxdg.noarch 0:0.18-1.el6 will be installed
--> Running transaction check
---> Package imsettings.x86_64 0:0.108.0-3.6.el6 will be installed
--> Processing Dependency: libgxim.so.2()(64bit) for package: imsettings-0.108.0-3.6.el6.x86_64
---> Package imsettings-libs.x86_64 0:0.108.0-3.6.el6 will be installed
--> Running transaction check
---> Package libgxim.x86_64 0:0.3.3-3.1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                 Arch         Version                  Repository  Size
================================================================================
Installing:
 ibus-anthy              x86_64       1.2.1-3.el6              base       133 k
 ipa-gothic-fonts        noarch       003.02-4.2.el6           base       3.6 M
 ipa-mincho-fonts        noarch       003.02-3.1.el6           base       5.0 M
 ipa-pgothic-fonts       noarch       003.02-4.1.el6           base       3.6 M
 ipa-pmincho-fonts       noarch       003.02-3.1.el6           base       5.0 M
 man-pages-ja            noarch       20100115-5.el6           base       5.5 M
 vlgothic-p-fonts        noarch       20091202-2.el6           base       2.2 M
Installing for dependencies:
 anthy                   x86_64       9100h-10.1.el6           base       6.0 M
 ibus                    x86_64       1.3.4-6.el6              base       337 k
 ibus-gtk                x86_64       1.3.4-6.el6              base        26 k
 ibus-libs               x86_64       1.3.4-6.el6              base        98 k
 im-chooser              x86_64       1.3.1-3.el6              base       144 k
 imsettings              x86_64       0.108.0-3.6.el6          base       190 k
 imsettings-libs         x86_64       0.108.0-3.6.el6          base       103 k
 kasumi                  x86_64       2.5-1.1.el6              base        72 k
 libgxim                 x86_64       0.3.3-3.1.el6            base       126 k
 pyxdg                   noarch       0.18-1.el6               base        79 k

Transaction Summary
================================================================================
Install      17 Package(s)

Total download size: 32 M
Installed size: 66 M
Downloading Packages:
(1/17): anthy-9100h-10.1.el6.x86_64.rpm                  | 6.0 MB     00:01
(2/17): ibus-1.3.4-6.el6.x86_64.rpm                      | 337 kB     00:00
(3/17): ibus-anthy-1.2.1-3.el6.x86_64.rpm                | 133 kB     00:00
(4/17): ibus-gtk-1.3.4-6.el6.x86_64.rpm                  |  26 kB     00:00
(5/17): ibus-libs-1.3.4-6.el6.x86_64.rpm                 |  98 kB     00:00
(6/17): im-chooser-1.3.1-3.el6.x86_64.rpm                | 144 kB     00:00
(7/17): imsettings-0.108.0-3.6.el6.x86_64.rpm            | 190 kB     00:00
(8/17): imsettings-libs-0.108.0-3.6.el6.x86_64.rpm       | 103 kB     00:00
(9/17): ipa-gothic-fonts-003.02-4.2.el6.noarch.rpm       | 3.6 MB     00:00
(10/17): ipa-mincho-fonts-003.02-3.1.el6.noarch.rpm      | 5.0 MB     00:00
(11/17): ipa-pgothic-fonts-003.02-4.1.el6.noarch.rpm     | 3.6 MB     00:00
(12/17): ipa-pmincho-fonts-003.02-3.1.el6.noarch.rpm     | 5.0 MB     00:00
(13/17): kasumi-2.5-1.1.el6.x86_64.rpm                   |  72 kB     00:00
(14/17): libgxim-0.3.3-3.1.el6.x86_64.rpm                | 126 kB     00:00
(15/17): man-pages-ja-20100115-5.el6.noarch.rpm          | 5.5 MB     00:00
(16/17): pyxdg-0.18-1.el6.noarch.rpm                     |  79 kB     00:00
(17/17): vlgothic-p-fonts-20091202-2.el6.noarch.rpm      | 2.2 MB     00:00
--------------------------------------------------------------------------------
Total                                           5.9 MB/s |  32 MB     00:05
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
 Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
 Package: centos-release-6-3.el6.centos.9.x86_64 (@anaconda-CentOS-201207061011.x86_64/6.3)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : ibus-libs-1.3.4-6.el6.x86_64                                1/17
  Installing : libgxim-0.3.3-3.1.el6.x86_64                                2/17
  Installing : imsettings-libs-0.108.0-3.6.el6.x86_64                      3/17
  Installing : anthy-9100h-10.1.el6.x86_64                                 4/17
  Installing : kasumi-2.5-1.1.el6.x86_64                                   5/17
  Installing : imsettings-0.108.0-3.6.el6.x86_64                           6/17
  Installing : im-chooser-1.3.1-3.el6.x86_64                               7/17
  Installing : pyxdg-0.18-1.el6.noarch                                     8/17
  Installing : ibus-1.3.4-6.el6.x86_64                                     9/17
  Installing : ibus-gtk-1.3.4-6.el6.x86_64                                10/17
  Installing : ibus-anthy-1.2.1-3.el6.x86_64                              11/17
  Installing : vlgothic-p-fonts-20091202-2.el6.noarch                     12/17
  Installing : ipa-pgothic-fonts-003.02-4.1.el6.noarch                    13/17
  Installing : man-pages-ja-20100115-5.el6.noarch                         14/17
  Installing : ipa-mincho-fonts-003.02-3.1.el6.noarch                     15/17
  Installing : ipa-gothic-fonts-003.02-4.2.el6.noarch                     16/17
  Installing : ipa-pmincho-fonts-003.02-3.1.el6.noarch                    17/17
  Verifying  : ibus-gtk-1.3.4-6.el6.x86_64                                 1/17
  Verifying  : ibus-anthy-1.2.1-3.el6.x86_64                               2/17
  Verifying  : ipa-pmincho-fonts-003.02-3.1.el6.noarch                     3/17
  Verifying  : imsettings-libs-0.108.0-3.6.el6.x86_64                      4/17
  Verifying  : anthy-9100h-10.1.el6.x86_64                                 5/17
  Verifying  : pyxdg-0.18-1.el6.noarch                                     6/17
  Verifying  : libgxim-0.3.3-3.1.el6.x86_64                                7/17
  Verifying  : kasumi-2.5-1.1.el6.x86_64                                   8/17
  Verifying  : ipa-gothic-fonts-003.02-4.2.el6.noarch                      9/17
  Verifying  : ipa-mincho-fonts-003.02-3.1.el6.noarch                     10/17
  Verifying  : ibus-libs-1.3.4-6.el6.x86_64                               11/17
  Verifying  : im-chooser-1.3.1-3.el6.x86_64                              12/17
  Verifying  : imsettings-0.108.0-3.6.el6.x86_64                          13/17
  Verifying  : man-pages-ja-20100115-5.el6.noarch                         14/17
  Verifying  : ibus-1.3.4-6.el6.x86_64                                    15/17
  Verifying  : ipa-pgothic-fonts-003.02-4.1.el6.noarch                    16/17
  Verifying  : vlgothic-p-fonts-20091202-2.el6.noarch                     17/17

Installed:
  ibus-anthy.x86_64 0:1.2.1-3.el6
  ipa-gothic-fonts.noarch 0:003.02-4.2.el6
  ipa-mincho-fonts.noarch 0:003.02-3.1.el6
  ipa-pgothic-fonts.noarch 0:003.02-4.1.el6
  ipa-pmincho-fonts.noarch 0:003.02-3.1.el6
  man-pages-ja.noarch 0:20100115-5.el6
  vlgothic-p-fonts.noarch 0:20091202-2.el6

Dependency Installed:
  anthy.x86_64 0:9100h-10.1.el6             ibus.x86_64 0:1.3.4-6.el6
  ibus-gtk.x86_64 0:1.3.4-6.el6             ibus-libs.x86_64 0:1.3.4-6.el6
  im-chooser.x86_64 0:1.3.1-3.el6           imsettings.x86_64 0:0.108.0-3.6.el6
  imsettings-libs.x86_64 0:0.108.0-3.6.el6  kasumi.x86_64 0:2.5-1.1.el6
  libgxim.x86_64 0:0.3.3-3.1.el6            pyxdg.noarch 0:0.18-1.el6

Complete!
#

i18nファイルを開いて、LANG=”ja_JP.UTF-8″に書き換えます。
# vim /etc/sysconfig/i18n

LANG="ja_JP.UTF-8"
SYSFONT="latarcyrheb-sun16"

使用言語が変更されたことを確認します。
# echo $LANG

# echo $LANG
ja_JP.utf8
#

フォントキャッシュを更新します。
# fc-cache -fv

# fc-cache -fv
/usr/share/fonts: caching, new cache contents: 0 fonts, 32 dirs
/usr/share/fonts/abyssinica: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/cjkuni-uming: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/default: caching, new cache contents: 0 fonts, 2 dirs
/usr/share/fonts/default/Type1: caching, new cache contents: 35 fonts, 0 dirs
/usr/share/fonts/default/ghostscript: caching, new cache contents: 17 fonts, 0 dirs
/usr/share/fonts/dejavu: caching, new cache contents: 21 fonts, 0 dirs
/usr/share/fonts/ipa-gothic: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/ipa-mincho: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/ipa-pgothic: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/ipa-pmincho: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/jomolhari: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/khmeros: caching, new cache contents: 3 fonts, 0 dirs
/usr/share/fonts/kurdit-unikurd-web: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/liberation: caching, new cache contents: 12 fonts, 0 dirs
/usr/share/fonts/lklug: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-assamese: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-bengali: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-devanagari: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-gujarati: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-kannada: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-oriya: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-punjabi: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-tamil: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/lohit-telugu: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/madan: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/paktype: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/sil-padauk: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/smc: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/stix: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/thai-scalable: caching, new cache contents: 4 fonts, 0 dirs
/usr/share/fonts/tibetan-machine-uni: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/un-core: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/vlgothic: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/wqy-zenhei: caching, new cache contents: 3 fonts, 0 dirs
/usr/share/X11/fonts/Type1: skipping, no such directory
/usr/share/X11/fonts/TTF: skipping, no such directory
/usr/local/share/fonts: skipping, no such directory
/root/.fonts: skipping, no such directory
/var/cache/fontconfig: cleaning cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded
#

CentOSを再起動します。
# reboot

以上で設定完了となります。

この記事はいかがでしたか?
良かったらポチッとお願いします!励みになります!!