setlocale: LC_ALL: cannot change locale (0.UTF-8)

Having issues with your DietPi installation, or, found a bug? Post it here.
hungryguy

setlocale: LC_ALL: cannot change locale (0.UTF-8)

Post by hungryguy »

Just had to re-install the latest version for my Pi downloaded today . (the backup I created on USB flash failed to reinstall but that's another story)
Anyway trying to install samba and openvpn and I get the following :/bin/bash: warning: setlocale: LC_ALL: cannot change locale (0.UTF-8)
This repeats many many, times and I don't know what I should do. I have tried to go in and set the locale from dietpi-config and I get a warning perl set locale failed?

Don't know where to go from here. Any help appreciated.
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: SET LOCALE?

Post by Fourdee »

hungryguy wrote:Just had to re-install the latest version for my Pi downloaded today . (the backup I created on USB flash failed to reinstall but that's another story)
Anyway trying to install samba and openvpn and I get the following :/bin/bash: warning: setlocale: LC_ALL: cannot change locale (0.UTF-8)
This repeats many many, times and I don't know what I should do. I have tried to go in and set the locale from dietpi-config and I get a warning perl set locale failed?

Don't know where to go from here. Any help appreciated.
Lets try a reset to en.GB:
  • dietpi-config > Language/Regional Options > Locale.
  • Scroll down to en_GB.UTF-8 UTF-8 and make sure it is ticked (*) with spacebar, then press enter
  • Select en_GB.UTF-8 as default locale, then press enter
  • reboot
Once rebooted, you should see the following when running locale:

Code: Select all

root@DietPi:~# locale
LANG=en_GB.UTF-8
LANGUAGE=
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
hungryguy

Re: setlocale: LC_ALL: cannot change locale (0.UTF-8)

Post by hungryguy »

Thanks very much for the fast reply. II have tried that more than once and it doesn't appear to save the changes after reboot. I still get this

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = "0.UTF-8",
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").
hungryguy

Re: setlocale: LC_ALL: cannot change locale (0.UTF-8)

Post by hungryguy »

Just to confirm locale comes up with this:
root@DietPi:~# ~# locale
-bash: ~#: command not found
root@DietPi:~# 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=en_GB.UTF-8
LANGUAGE=
LC_CTYPE="0.UTF-8"
LC_NUMERIC="0.UTF-8"
LC_TIME="0.UTF-8"
LC_COLLATE="0.UTF-8"
LC_MONETARY="0.UTF-8"
LC_MESSAGES="0.UTF-8"
LC_PAPER="0.UTF-8"
LC_NAME="0.UTF-8"
LC_ADDRESS="0.UTF-8"
LC_TELEPHONE="0.UTF-8"
LC_MEASUREMENT="0.UTF-8"
LC_IDENTIFICATION="0.UTF-8"
LC_ALL=0.UTF-8
root@DietPi:~#
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: setlocale: LC_ALL: cannot change locale (0.UTF-8)

Post by Fourdee »

hungryguy wrote:Just to confirm locale comes up with this:

LC_ALL=0.UTF-8
root@DietPi:~#

Please paste results of:

Code: Select all

cat /etc/locale.gen | grep '^[a-z0-9]'
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
User avatar
Sciamano
Posts: 264
Joined: Sat Oct 15, 2016 12:18 pm
Location: Italy

Re: setlocale: LC_ALL: cannot change locale (0.UTF-8)

Post by Sciamano »

May I suggest:

Code: Select all

dpkg-reconfigure locales
and see what happens?
hungryguy

Re: setlocale: LC_ALL: cannot change locale (0.UTF-8)

Post by hungryguy »

Results posted as requested:
root@DietPi:~# cat /etc/locale.gen | grep '^[a-z0-9]'
en_GB.UTF-8 UTF-8
root@DietPi:~#
root@DietPi:~# Fourdee
-bash: Fourdee: command not found
root@DietPi:~# Site Admin
-bash: Site: command not found
root@DietPi:~#
root@DietPi:~# Posts: 1448
-bash: Posts:: command not found
root@DietPi:~# Joined: Tue Feb 06, 2007 12:36 pm
-bash: Joined:: command not found
root@DietPi:~#
root@DietPi:~#
hungryguy

Re: setlocale: LC_ALL: cannot change locale (0.UTF-8)

Post by hungryguy »

Sciamano wrote:May I suggest:

Code: Select all

dpkg-reconfigure locales
and see what happens?

No luck wont change locales:-

root@DietPi:~# dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = "0.UTF-8",
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").
Generating locales (this might take a while)...
en_GB.UTF-8... done
Generation complete.
User avatar
Sciamano
Posts: 264
Joined: Sat Oct 15, 2016 12:18 pm
Location: Italy

Re: setlocale: LC_ALL: cannot change locale (0.UTF-8)

Post by Sciamano »

That's odd!
alessandro.psrt
Posts: 16
Joined: Tue Dec 06, 2016 2:34 pm

Re: setlocale: LC_ALL: cannot change locale (0.UTF-8)

Post by alessandro.psrt »

It happen to me when I removed a package that now I can't remember exactly. Look in /etc/environment and change 0.UTF-8 to your locale, or comment according to https://wiki.debian.org/Locale#Standard.

Hope this helps.
Post Reply