無効なUbuntuロケール:そのファイルまたはディレクトリはありません。

無効なUbuntuロケール:そのファイルまたはディレクトリはありません。

Ubuntu 20でロケールを設定しようとしましたが(過去x年間に成功しました)、残念ながら今は何かが欠けているため設定できません。

$ locale     
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=hu_HU.UTF-8
LANGUAGE=hu_HU.UTF-8
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=C.UTF-8

私が試したこと:

sudo localectl set-locale LC_ALL=hu_HU.UTF-8
Failed to issue method call: Invalid Locale data.

(私もc.UTF-8同じ出力を使ってみました)

$ sudo update-locale
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = "hu_HU.UTF-8",
    LC_ALL = "C.UTF-8",
    LANG = "hu_HU.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

sudo dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = "hu_HU.UTF-8",
    LC_ALL = "C.UTF-8",
    LANG = "hu_HU.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline

$ sudo nano /etc/default/locale

上記のように、LANG、LANGUAGE、LC_ALLを編集しますが、何の効果もありません。

システム全体が何度も再起動されました。

私は何が間違っていましたか?私が好むロケールは気にしません。これで問題なく効率的に動作します。

助けてくれてありがとう。

ベストアンサー1

だから多くの時間を費やした後に解決策を見つけました。まず、次から(手動で)挿入されたすべての構成を削除します。

sudo nano /etc/environment (delete rows)
sudo nano /etc/locale.conf (delete rows)
sudo nano /etc/default/locale

--> /etc/default/localeからデフォルト値に変更/設定します。例: C.UTF-8

それから(Ubuntu 20):

nano .bashrc

-->上記のようにここにデフォルト値を追加します。

source .bashrc
reboot

これでエラーや警告メッセージがなくなりました:)

おすすめ記事