LoginSignup
25
17

More than 3 years have passed since last update.

Debian/Ubuntuのロケールを日本語にする方法

Last updated at Posted at 2019-06-29

最近、Dockerを使えるようになってプログラミングのスピードがとても早くて楽しいです。
環境構築に手間取っていた時期が懐かしいです。

けど、立ち上げたDockerコンテナは、デフォルトのロケールが日本語に対応してないので、locale変更する必要がありますよね。
毎回、設定方法を調べてやっているので、メモとして残しました。

Debinの場合

# root環境
apt-get update
apt-get install locales -y
# ja_JP.UTF-8の行のコメントを解除
sed -i -E 's/# (ja_JP.UTF-8)/\1/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8

Ubuntuの場合

# root環境
apt-get install language-pack-ja
update-locale LANG=ja_JP.UTF-8

bashに書き込み読み込む(共通)

# root環境
echo 'export LANG=ja_JP.UTF-8' >> ~/.bashrc
source ~/.bashrc
25
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
25
17