15
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS7のlocale変更

Last updated at Posted at 2016-05-25

vagrant上のCentOS7が突然日本語でなくなってしまったので、修正メモ。

# タイムゾーン

[root@localhost ~]# date
Mi 25. Mai 13:13:39 CEST 2016

どこのこれなんでこうなった・・・
修正!

[root@localhost ~]# cp /usr/share/zoneinfo/Japan /etc/localtime
cp: „/etc/localtime“ überschreiben? y
[root@localhost ~]# date
Mi 25. Mai 20:14:21 JST 2016

JSTになったよお!

locale

[root@localhost ~]# locale
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=

なんのこっちゃ。おどいつ語だそうですよ。

使えるlocale調べるよ。

[root@localhost sysconfig]# localectl list-locales
aa_DJ
aa_DJ.iso88591
aa_DJ.utf8
aa_ER
aa_ER.utf8
aa_ER.utf8@saaho
aa_ER@saaho
aa_ET
aa_ET.utf8
以下略

日本語だけ調べてみる。

[root@localhost sysconfig]# localectl list-locales | grep -i ja
ja_JP
ja_JP.eucjp
ja_JP.ujis
ja_JP.utf8
japanese
japanese.euc

日本語に直す!

[root@localhost sysconfig]# localectl set-locale LANG=ja_JP.utf8
[root@localhost sysconfig]# cat /etc/locale.conf
LANG=ja_JP.utf8

その後再ロングイン。

現在のlocale等の確認

[vagrant@localhost ~]$ date
2016年  5月 25日 水曜日 20:18:39 JST
[vagrant@localhost ~]$ localectl status
   System Locale: LANG=ja_JP.utf8
       VC Keymap: de
      X11 Layout: de

??? Keymapってなんぞ。
とりあえず変えてみる。

[vagrant@localhost ~]$ localectl set-keymap jp106
==== AUTHENTICATING FOR org.freedesktop.locale1.set-keyboard ===
Authentication is required to set the system keyboard settings.
Authenticating as: root
Password: 
==== AUTHENTICATION COMPLETE ===

再度localeの確認。

[vagrant@localhost ~]$ localectl status
   System Locale: LANG=ja_JP.utf8
       VC Keymap: jp106
      X11 Layout: jp
       X11 Model: jp106
     X11 Options: terminate:ctrl_alt_bksp

とりあえずここまで・・・・・・


参考
http://weblabo.oscasierra.net/vagrant-centos6-japanize/
http://zero-config.com/centos/changelocale-002.html
http://qiita.com/sue71/items/64c513ae181e9f7aa8f4

15
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?