0

I've tried setting my locales in ubuntu 20 (I did it successfully in the last x years) unfortunatelly now I can't due something missing:

$ 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

What I have tried:

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

(I've tried also with c.UTF-8 the same output)

$ 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

edited here the LANG, LANGUAGE, LC_ALL settings as above, without any effect

restarted many times the whole system...

what did I wrong? I don't care of my preffered locale setting, it should more work now without any issue.

Thanks for helping.

5
  • 1
    what's the output of locale -a Mar 6, 2023 at 22:47
  • $ locale -a 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_COLLATE to default locale: No such file or directory C POSIX I've also tried a few times: $ sudo locale-gen hu_HU.UTF-8 but this also did not resolve the issue.
    – Erkman
    Mar 7, 2023 at 6:31
  • what did that command result in? did you read the manual for locale-gen? man locale-gen? it doesn't take any arguments, so of course that did nothing. Perhaps you need to edit /etc/locale.gen as appropriate to your needs (and then run sudo locale-gen) Mar 7, 2023 at 7:26
  • $ sudo locale-gen /bin/bash: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8) Generating locales (this might take a while)... hu_HU.UTF-8.../usr/sbin/locale-gen: line 177: 1360 Killed localedef $no_archive -i $input -c -f $charset $locale_alias $locale done Generation complete. - Obviously the propper locale has been uncommented, so this should not be the problem and this did not solve the issue. What's your next opinion?
    – Erkman
    Mar 8, 2023 at 5:59
  • "Obviously" - well, to you it is, to me it isn't since you're the one with the system that doesn't work Mar 8, 2023 at 6:15

1 Answer 1

0

So after spend so much hours I found the solution: First of all, remove all (manually) inserted confs from:

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

--> in /etc/default/locale change/set to your default, ex. C.UTF-8

then (Ubuntu 20):

nano .bashrc

--> add the your default also here like above

source .bashrc
reboot

and now, no error or warning messages anymore :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .