Ubuntu 22.04 LTS に日本語環境にする方法

環境
OSバージョンの確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
# cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"

 

操作方法
1.日本語関連のパッケージをインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# apt -y install language-pack-ja-base language-pack-ja
# apt -y install language-pack-ja-base language-pack-ja
# apt -y install language-pack-ja-base language-pack-ja

2.システムの文字セットを日本語に変更します。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# localectl set-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja"
# source /etc/default/locale
# localectl set-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja" # source /etc/default/locale
# localectl set-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja"
# source /etc/default/locale

確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
root@ark-virtual-machine:/home/ark# echo $LANG
ja_JP.UTF-8
root@ark-virtual-machine:/home/ark# echo $LANG ja_JP.UTF-8
root@ark-virtual-machine:/home/ark# echo $LANG
ja_JP.UTF-8

 

3.コマンド実行確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
root@ark-virtual-machine:/home/ark# passwd
新しい パスワード:
よくないパスワード: パスワードが与えられていません。
新しい パスワードを再入力してください:
root@ark-virtual-machine:/home/ark# passwd 新しい パスワード: よくないパスワード: パスワードが与えられていません。 新しい パスワードを再入力してください:
root@ark-virtual-machine:/home/ark# passwd
新しい パスワード:
よくないパスワード: パスワードが与えられていません。
新しい パスワードを再入力してください:

4.デスクトップ関連のパッケージをインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# apt -y install task-japanese-gnome-desktop language-pack-gnome-ja-base language-pack-gnome-ja gnome-user-docs-ja libreoffice-help-ja libreoffice-l10n-ja thunderbird-locale-ja fonts-noto-cjk-extra
# apt -y install task-japanese-gnome-desktop language-pack-gnome-ja-base language-pack-gnome-ja gnome-user-docs-ja libreoffice-help-ja libreoffice-l10n-ja thunderbird-locale-ja fonts-noto-cjk-extra
# apt -y install task-japanese-gnome-desktop language-pack-gnome-ja-base language-pack-gnome-ja gnome-user-docs-ja libreoffice-help-ja libreoffice-l10n-ja thunderbird-locale-ja fonts-noto-cjk-extra

5.下記のコマンドを実行します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# startx
xauth: file /root/.Xauthority does not exist
X.Org X Server 1.21.1.3
X Protocol Version 11, Revision 0
Current Operating System: Linux ark-virtual-machine 5.15.0-48-generic #54-Ubuntu SMP Fri Aug 26 13:26:29 UTC 2022 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.15.0-48-generic root=UUID=c0df1308-e2d0-4a6e-adae-8208a0ec081a ro find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US quiet splash
xorg-server 2:21.1.3-2ubuntu2.1 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.40.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Thu Sep 29 23:18:27 2022
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
xinit: connection to X server lost
waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.
# startx xauth: file /root/.Xauthority does not exist X.Org X Server 1.21.1.3 X Protocol Version 11, Revision 0 Current Operating System: Linux ark-virtual-machine 5.15.0-48-generic #54-Ubuntu SMP Fri Aug 26 13:26:29 UTC 2022 x86_64 Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.15.0-48-generic root=UUID=c0df1308-e2d0-4a6e-adae-8208a0ec081a ro find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US quiet splash xorg-server 2:21.1.3-2ubuntu2.1 (For technical support please see http://www.ubuntu.com/support) Current version of pixman: 0.40.0 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/var/log/Xorg.0.log", Time: Thu Sep 29 23:18:27 2022 (==) Using system config directory "/usr/share/X11/xorg.conf.d" xinit: connection to X server lost waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.
# startx
xauth:  file /root/.Xauthority does not exist


X.Org X Server 1.21.1.3
X Protocol Version 11, Revision 0
Current Operating System: Linux ark-virtual-machine 5.15.0-48-generic #54-Ubuntu SMP Fri Aug 26 13:26:29 UTC 2022 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.15.0-48-generic root=UUID=c0df1308-e2d0-4a6e-adae-8208a0ec081a ro find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US quiet splash
xorg-server 2:21.1.3-2ubuntu2.1 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.40.0
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Thu Sep 29 23:18:27 2022
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
xinit: connection to X server lost

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.

6.サーバーにログインします
日本語環境にすることを確認します。

Ubuntu 22.04

Posted by arkgame