Changing Locale Issue
Hello, I have a bit of a problem. I can't seem to chnage the locale of my raspbian system. I have taken many attempts, incluing manually change the locale in the defualt locale file, and no matter what I do it always says it generates and used en_GB.UTF-8, when I need en_US.UTF. Not that it matters much, but my owncloud installation complains and won't play back music or sync some files until I fix it.....
Here's the commands I've tried:
sudo nano /etc/default/locale
sudo locale-gen --purge it_IT.UTF-8 en_US.UTF-8 && echo "Success"
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
And here is was the server always reports back when I try to make any changes.....
Generating locales (this might take a while)...
en_GB.UTF-8...
Can someone please help me? This is driving me up a wall.
Here's the commands I've tried:
sudo nano /etc/default/locale
sudo locale-gen --purge it_IT.UTF-8 en_US.UTF-8 && echo "Success"
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
And here is was the server always reports back when I try to make any changes.....
Generating locales (this might take a while)...
en_GB.UTF-8...
Can someone please help me? This is driving me up a wall.
Re: Changing Locale Issue
A stretch but have you tried in sudo raspi-config
Outside of that I wonder if something is either overwriting the change this shouldn't occur on default setup or have you changed or setup a default user and missed a permission setting somewhere?
Outside of that I wonder if something is either overwriting the change this shouldn't occur on default setup or have you changed or setup a default user and missed a permission setting somewhere?
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
Re: Changing Locale Issue
Here's some more info based on the last reponse:
sudo raspi-config
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_MESSAGES = "POSIX",
LANG = "en_US.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_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Generating locales (this might take a while)...
en_GB.UTF-8... done
Generation complete.
locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX
en_GB.utf8
EDIT: i just found this..... bet this is part of the problem. http://imgur.com/MP3405R
Anyone know whats up based on ths output? Thank you.
sudo raspi-config
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_MESSAGES = "POSIX",
LANG = "en_US.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_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Generating locales (this might take a while)...
en_GB.UTF-8... done
Generation complete.
locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX
en_GB.utf8
EDIT: i just found this..... bet this is part of the problem. http://imgur.com/MP3405R
Anyone know whats up based on ths output? Thank you.
Re: Changing Locale Issue
Mine looks the same setting are US
Code: Select all
^?ELF^A^A^A^@^@^@^@^@^@^@^@^@^B^@(^@^A^@^@^@ �^@^@4^@^@^@�w^@^@^B^@^@^E4^@ ^^@^@^@^@^@^@^@3^@^@^@^_^@^@^@<^@^@^@^@^@^@^@5^@^@^@?^@^@^@^@^@^@^@^@^@^@^@^M^@^$
� ^H0�d`D )4^@^@}^H�^ED^@^@^@^@^@^@^@^@^@^@^@^@^B^@^@^@^D^@^@^@^@^@^@^@^F^^@^@^@^L^@^@^@^M^@^@^@^N^@^@^@^Q^@^@^@^R^@^@^@^S^@^@^@^@^@^@^@^U^@^@^@^W^@^@^@^$
^@^@�`^A^@^V^R^@^@�`^A^@^V/^@^@�`^A^@^V^A^@^@�`^A^@^V^Z^@^@�`^A^@^V%^@^E^@��8^T������^@@P��^@^@
,^D��O���^@���^H^P��^L0��^P���^X^D��^L ��^^P0��^H ��^B^@S�t^@^@¿½ï¿½^S��^@0��^@^@S�f^@^@^Z�$
^H^P��^C^@Q�G^@^@�^L^P�å´ï¿½å´^A��ã´^Ca�ç´^@��ã´^A �â´^P ï^D���^F^@��^K^P������^@^@P�O^@^@
^Hp��^@^@W�;^@^@
^L@��^@P��^C^@^@�^AP��^G^@U�^X@��4^@^@
^F^@��^D^P������^@^@P����^Z0^S��^D0��^@^@S�^A^^K^@��5���^D^@���^A^@�^P0������^\^C��^T0��!^F^@�^@�^T^P���"��C���^D^@��o^G^@�^E^@��q^F^@�^$^C^@�^@^@��^O���,"��^D0��^@^@S�f^@^@^Z,2��
���^H`��^@^@V�^@@�^S^LP�^U���
^E^@��^A@���^A^@�^F^@T�^XP�����^Z^P0������ï¿^AP��^@@��p��å�å^M^@^@ê^@^@Sã^F^P�^Q^C^@^@^Z^@^P å^@^@Qã^G^P�^
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
Re: Changing Locale Issue
Try something like:
seems similar issues and 50 50 chance of one stop solutions
http://hexample.com/2012/02/05/fixing-l ... em-debian/
Code: Select all
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales
http://hexample.com/2012/02/05/fixing-l ... em-debian/
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
Re: Changing Locale Issue
Do you mean that it crashes at that point, or just that it never generates any other locales? Edit /etc/locale.gen and uncomment the line "en_US.UTF-8 UTF-8" and any others you need.dh04000 wrote:Generating locales (this might take a while)...
en_GB.UTF-8...
Code: Select all
pi@delta ~ $ sudo locale-gen
Generating locales (this might take a while)...
en_GB.UTF-8... done
en_US.UTF-8... done
ja_JP.UTF-8... done
pl_PL.UTF-8... done
sv_SE.UTF-8... done
Generation complete.
Re: Changing Locale Issue
[quote="jojopi"] Edit /etc/locale.gen and uncomment the line "en_US.UTF-8 UTF-8" and any others you need.
This worked!!! Thank you so much! The error in my owncloud installation is gone as well! Thank you!
This thread can now be closed. I no longer have any issues.
This worked!!! Thank you so much! The error in my owncloud installation is gone as well! Thank you!

This thread can now be closed. I no longer have any issues.

-
- Posts: 1
- Joined: Thu Sep 12, 2013 3:46 am
Re: Changing Locale Issue
Just in case someone finds this from a search engine and has the same issue. I had the same issue with locales. It turns out this was a PEBKAC issue. I was using:
When attempting to activate the en_US.UTF-8 UTF-8 locale, I was hitting the Enter key. The enter key does NOT select the locale option. Instead it activates the <Ok> button effectively advancing to the next screen without activating the locale. What I needed to do was to highlight the en_US.UTF-8 UTF-8 and mark it as active using the spacebar. Then press enter or tab over to the <Ok> button.
I hope this helps someone else.
Code: Select all
sudo dpkg-reconfigure locales
I hope this helps someone else.
Re: Changing Locale Issue
Some time passed, but I'm having exactly the same issue here. With the slight difference that I'm not making any progress. Mi rpi simply is unable to generate any locale. It reboots every time, whatever I tried before does not make any difference. says
Adding sudo to raspi-config does not change the result.
P.S. I'm on raspbian installed and updated today. It failed already during the first raspi-config but there I thought it was a windows-style reboot-to-activate-changes reboot. Seems it was not.
Code: Select all
locale -a
Code: Select all
C
C.UTF-8
POSIX
P.S. I'm on raspbian installed and updated today. It failed already during the first raspi-config but there I thought it was a windows-style reboot-to-activate-changes reboot. Seems it was not.
- DougieLawson
- Posts: 42481
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Changing Locale Issue
sudo nano /etc/locale.gen
Remove the # from every line which you want to generate.
save the file
then run sudo /usr/sbin/locale-gen
Remove the # from every line which you want to generate.
save the file
then run sudo /usr/sbin/locale-gen
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: Changing Locale Issue
My guess is that you have a power(-supply) issue.rickx wrote:Mi rpi simply is unable to generate any locale. It reboots every time, whatever I tried before does not make any difference.
When I powered my Pi through an USB cable from another machine I could make my Pi crash quite regularly (but not always) when running 'dpkg-reconfigure locales' (also with tzdata btw).
I now power my Pi with the charger cable from my phone and that (seems to have) resolved it.
Re: Changing Locale Issue
I'm quite content with the GB locales but also getting crashes if I try to upgrade and sure enough it's while dpkg is configuring the locales. As soon as that process starts the box becomes unpingable and I'm having to reform the card each time.
Currently I'm running on a 5V 1A adapter for a mobile phone but still it's over a USB cable and not directly wired into the PSU. I will try to get hold of a 1.2A supply and see if that makes any difference.
Currently I'm running on a 5V 1A adapter for a mobile phone but still it's over a USB cable and not directly wired into the PSU. I will try to get hold of a 1.2A supply and see if that makes any difference.
Re: Changing Locale Issue
USB cable is typical, but if it's a long cable or low quality, ir could introduce too much resistance. If the charger is low quality or old, it may not be supplying the required 5v at the necessary amperage. It would be worth testing both of those.chriswnl wrote:I'm quite content with the GB locales but also getting crashes if I try to upgrade and sure enough it's while dpkg is configuring the locales. As soon as that process starts the box becomes unpingable and I'm having to reform the card each time.
Currently I'm running on a 5V 1A adapter for a mobile phone but still it's over a USB cable and not directly wired into the PSU. I will try to get hold of a 1.2A supply and see if that makes any difference.
Re: Changing Locale Issue
I get this failure below when I do upgrade each time there is something to upgrade:
Get:11 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libopenjpeg2 armhf 1.3+dfsg-4.8 [76.2 kB]
Get:12 http://mirrordirector.raspbian.org/raspbian/ wheezy/main tzdata all 2014a-0wheezy1 [445 kB]
Fetched 7947 kB in 5s (1349 kB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_MESSAGES = "sv_SE.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
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
Preconfiguring packages ...
(Reading database ... 74426 files and directories currently installed.)
Preparing to replace libxml2:armhf 2.8.0+dfsg1-7+nmu2 (using .../libxml2_2.8.0+dfsg1-7+nmu3_armhf.deb) ...
I have only en_US.UTF-8 UTF-8 as locale. I have US keyboard and the only Swedish about my system is that I have the Swedish timezone. I configured locale using sudo raspi-config. Raspi-config didn't crash and I don't think I have power-supply problems.
I checked /etc/locale.gen and it has comments before each line.
# en_US ISO-8859-1
# en_US.ISO-8859-15 ISO-8859-15
en_US.UTF-8 UTF-8
# en_ZA ISO-8859-1
# en_ZA.UTF-8 UTF-8
Any ideas what could be wrong?
Get:11 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libopenjpeg2 armhf 1.3+dfsg-4.8 [76.2 kB]
Get:12 http://mirrordirector.raspbian.org/raspbian/ wheezy/main tzdata all 2014a-0wheezy1 [445 kB]
Fetched 7947 kB in 5s (1349 kB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_MESSAGES = "sv_SE.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
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
Preconfiguring packages ...
(Reading database ... 74426 files and directories currently installed.)
Preparing to replace libxml2:armhf 2.8.0+dfsg1-7+nmu2 (using .../libxml2_2.8.0+dfsg1-7+nmu3_armhf.deb) ...
I have only en_US.UTF-8 UTF-8 as locale. I have US keyboard and the only Swedish about my system is that I have the Swedish timezone. I configured locale using sudo raspi-config. Raspi-config didn't crash and I don't think I have power-supply problems.
I checked /etc/locale.gen and it has comments before each line.
# en_US ISO-8859-1
# en_US.ISO-8859-15 ISO-8859-15
en_US.UTF-8 UTF-8
# en_ZA ISO-8859-1
# en_ZA.UTF-8 UTF-8
Any ideas what could be wrong?
Last edited by mob-i-l on Sun Apr 27, 2014 11:38 am, edited 1 time in total.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ rasPiOS. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/
- DougieLawson
- Posts: 42481
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Changing Locale Issue
Have you set your locale using sudo raspi-config?
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: Changing Locale Issue
Yes. All settings are US with UTF-8 except timezone that is Stockholm, Sweden.DougieLawson wrote:Have you set your locale using sudo raspi-config?
Have Pi0&1A&1B&1B+&2B&3B&4B w/ rasPiOS. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/
- DougieLawson
- Posts: 42481
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Changing Locale Issue
Have you looked at /etc/locale.gen file and the sudo locale-gen command to be sure you have all the en_* and sv_* locales generated?
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: Changing Locale Issue
Yes, I quoted part of my /etc/locale.gen file in my first post. I have used sudo locale-gen.DougieLawson wrote:Have you looked at /etc/locale.gen file and the sudo locale-gen command to be sure you have all the en_* and sv_* locales generated?
sudo /usr/sbin/locale-gen
Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.
Why should I have all English and Swedish locales if I only want en_US.UTF-8 UTF-8? I don't want Swedish locale – I only want to use the Swedish timezone. If you needed all locales for a language then I suppose raspi-config should have brought in all when I choose one of them in the text-based GUI.
I don't know how to reproduce an upgrade, so I can't experiment with adding the Swedish locale and see if it helps. There seems to be something strange with Perl and maybe I could narrow down the bug if there where some Perl-program that reproduces the same error message. This error message pops up in other circumstances also.
Have Pi0&1A&1B&1B+&2B&3B&4B w/ rasPiOS. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/
Re: Changing Locale Issue
I understand this error now. It is because I log in to my Raspberry Pi from a terminal on a partially Swedish system. It doesn't occur when I run directly on Pi.
I also discovered how to reproduce the problem:
See http://stackoverflow.com/questions/2499 ... -from-perl
I also discovered how to reproduce the problem:
Code: Select all
perl -e exit
Have Pi0&1A&1B&1B+&2B&3B&4B w/ rasPiOS. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/
- DougieLawson
- Posts: 42481
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Changing Locale Issue
What do you have in /etc/ssh/ssh_config and /etc/ssh/sshd_config for your locale settings?
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: Changing Locale Issue
I have these but I have not changed these files manually:DougieLawson wrote:What do you have in /etc/ssh/ssh_config and /etc/ssh/sshd_config for your locale settings?
In /etc/ssh/ssh_config:
SendEnv LANG LC_*
In /etc/ssh/sshd_config:
AcceptEnv LANG LC_*
Have Pi0&1A&1B&1B+&2B&3B&4B w/ rasPiOS. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/
Re: Changing Locale Issue
I guess I'll jump on this thread, I'm having big problems with locales, namely:
From googling, that happens when it runs out of RAM and the solution is to add a swap file but I can't do that on a Raspberry pi?
Code: Select all
Generating locales (this might take a while)...
en_GB.UTF-8...Killed
done
Generation complete.
Re: Changing Locale Issue
I haven't tried it myself, but you could try the suggestion from https://github.com/hifi/raspbian-ua-netinst#first-bootxerosis wrote:From googling, that happens when it runs out of RAM and the solution is to add a swap file but I can't do that on a Raspberry pi?
Optional: Create a swap file with(example is 512MB) and enable it on boot by appendingCode: Select all
dd if=/dev/zero of=/swap bs=1M count=512 && mkswap /swap
to /etc/fstab.Code: Select all
/swap none swap sw 0 0
Re: Changing Locale Issue
Thanks, I haven't tried that exact method but a similar one failed as there was no disk space on the sdcard left?diederik wrote:I haven't tried it myself, but you could try the suggestion from https://github.com/hifi/raspbian-ua-netinst#first-bootxerosis wrote:From googling, that happens when it runs out of RAM and the solution is to add a swap file but I can't do that on a Raspberry pi?Optional: Create a swap file with(example is 512MB) and enable it on boot by appendingCode: Select all
dd if=/dev/zero of=/swap bs=1M count=512 && mkswap /swap
to /etc/fstab.Code: Select all
/swap none swap sw 0 0
Re: Changing Locale Issue
That was probably when you tried to create a swap partition, which is the most common used way.
With the method posted above, you'll create a swap file in your root partition. The command 'df -h' should tell you how much free space you have. If you have less then 512MB free, you have other issues to worry about
With the method posted above, you'll create a swap file in your root partition. The command 'df -h' should tell you how much free space you have. If you have less then 512MB free, you have other issues to worry about
