Introduction
Greetings everyone, I just moved from Ubuntu to Manjaro 21.2.6 (Qonos) yesterday.
So here’s the story, after I installed Manjaro on my laptop, I found that my Japanese songs that use Japanese fonts don’t exist in terminal. So I tried to enable line #ja_JP.UTF-8 UTF-8
on /etc/locale.gen
and run sudo locale.gen
but this doesn’t work, my fonts still didn’t show. Then I try to install ttf-sazanami
and ttf-hanazono
on pacman
but still don’t works, however after I install noto-fonts-cjk
use sudo pamac install noto-fonts-cjk
it’s works. After that I remove the fonts sazanami and hazono wich I install before.
The problem
The problem is, when I run a command related to sudo, for example sudo --help
in a normal terminal, it shows:
[sann@sann-x86-64 ~]$ sudo --help
sudo - 別のユーザーとしてコマンドを実行します
usage: sudo -h | -K | -k | -V
usage: sudo -v [-ABknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-ABknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-ABbEHknPS] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-ABknS] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] file ...
オプション:
-A, --askpass パスワード要求のために補助プログラムを使用する
-b, --background コマンドをバックグラウンドで実行する
-B, --bell プロンプトと同時にベルを鳴らす
-C, --close-from=num num 以上のすべてのファイル記述子を閉じる
-D, --chdir=directory コマンド実行前に作業ディレクトリを変更する
-E, --preserve-env コマンドを実行する時にユーザーの環境変数を維持する
--preserve-env=list 指定の環境変数を維持する
-e, --edit コマンドを実行するのではなくファイルを編集する
-g, --group=group 指定したグループ名またはグループIDでコマンドを実行する
-H, --set-home HOME 変数を変更先となるユーザーのホームディレクトリに設定する
-h, --help このヘルプを表示して終了する
-h, --host=host host でコマンドを実行する(プラグインがサポートしている場合)
-i, --login 変更先のユーザーとしてログインシェルを実行する; コマンドを指定することもできます
-K, --remove-timestamp タイムスタンプファイルを完全に削除する
-k, --reset-timestamp 無効なタイムスタンプファイルです
-l, --list ユーザーの権限を一覧表示するまたは指定したコマンドについて確認する
;長い表示にするには2回指定すること
-n, --non-interactive 非対話モードで実行し、ユーザーに入力を求めない
-P, --preserve-groups グループベクトルを保護する (変更先のユーザーのものに設定しない)
-p, --prompt=prompt 指定したパスワードプロンプトを使用する
-R, --chroot=directory コマンド実行前にルートディレクトリを変更する
-S, --stdin 標準入力からパスワードを読み込む
-s, --shell 変更先のユーザーとしてシェルを実行する; コマンドを指定することもできます
-T, --command-timeout=timeout 指定した制限時間でコマンドの実行を中止する
-U, --other-user=user リストモードで、ユーザーの権限を表示する
-u, --user=user 指定したユーザー名またはユーザーIDでコマンドを実行する (またはファイルを編集する)
-V, --version バージョン情報を表示して終了する
-v, --validate コマンドを実行せずにユーザーのタイムスタンプを更新する
-- コマンドライン引数の処理を終了する
However, when I run sudo --help
on a tty terminal (Ctrl+Alt+F2
), it shows normal output:
[sann@sann-x86-64 ~]$ sudo --help
sudo - execute a command as another user
usage: sudo -h | -K | -k | -V
usage: sudo -v [-ABknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-ABknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-ABbEHknPS] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-ABknS] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] file ...
Options:
-A, --askpass use a helper program for password prompting
-b, --background run command in the background
-B, --bell ring bell when prompting
-C, --close-from=num close all file descriptors >= num
-D, --chdir=directory change the working directory before running command
-E, --preserve-env preserve user environment when running command
--preserve-env=list preserve specific environment variables
-e, --edit edit files instead of running a command
-g, --group=group run command as the specified group name or ID
-H, --set-home set HOME variable to target user's home dir
-h, --help display help message and exit
-h, --host=host run command on host (if supported by plugin)
-i, --login run login shell as the target user; a command may also be specified
-K, --remove-timestamp remove timestamp file completely
-k, --reset-timestamp invalidate timestamp file
-l, --list list user's privileges or check a specific command; use twice for longer format
-n, --non-interactive non-interactive mode, no prompts are used
-P, --preserve-groups preserve group vector instead of setting to target's
-p, --prompt=prompt use the specified password prompt
-R, --chroot=directory change the root directory before running command
-S, --stdin read password from standard input
-s, --shell run shell as the target user; a command may also be specified
-T, --command-timeout=timeout terminate command after the specified time limit
-U, --other-user=user in list mode, display privileges for user
-u, --user=user run command (or edit file) as specified user name or ID
-V, --version display version information and exit
-v, --validate update user's timestamp without running a command
-- stop processing command line arguments
Conclusion
So how to fix it, so that normal terminal language can be normal like the one in the tty terminal output?, Because after I translated it, it was the real Japanese language text.
I have tried deleting the line ja_JP.UTF-8 UTF-8
again by add #
on /etc/locale.gen
and run sudo locale-gen
, but doesn’t take effects. Btw I’m Indonesian and use Indonesian language.
[sann@sann-x86-64 ~]$ locale
LANG=id_ID.UTF-8
LC_CTYPE="id_ID.UTF-8"
LC_NUMERIC=id_ID.UTF-8
LC_TIME=id_ID.UTF-8
LC_COLLATE="id_ID.UTF-8"
LC_MONETARY=id_ID.UTF-8
LC_MESSAGES="id_ID.UTF-8"
LC_PAPER=id_ID.UTF-8
LC_NAME=id_ID.UTF-8
LC_ADDRESS=id_ID.UTF-8
LC_TELEPHONE=id_ID.UTF-8
LC_MEASUREMENT=id_ID.UTF-8
LC_IDENTIFICATION=id_ID.UTF-8
LC_ALL=