dh04000
Posts: 62
Joined: Tue Oct 04, 2011 9:18 pm

Changing Locale Issue

Sun Mar 24, 2013 3:27 pm

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.

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am

Re: Changing Locale Issue

Sun Mar 24, 2013 3:37 pm

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?
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)

dh04000
Posts: 62
Joined: Tue Oct 04, 2011 9:18 pm

Re: Changing Locale Issue

Sun Mar 24, 2013 3:51 pm

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.

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am

Re: Changing Locale Issue

Sun Mar 24, 2013 4:27 pm

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)

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am

Re: Changing Locale Issue

Sun Mar 24, 2013 4:36 pm

Try something like:

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
seems similar issues and 50 50 chance of one stop solutions

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)

User avatar
jojopi
Posts: 3812
Joined: Tue Oct 11, 2011 8:38 pm

Re: Changing Locale Issue

Sun Mar 24, 2013 4:40 pm

dh04000 wrote:Generating locales (this might take a while)...
en_GB.UTF-8...
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.

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.

dh04000
Posts: 62
Joined: Tue Oct 04, 2011 9:18 pm

Re: Changing Locale Issue

Sun Mar 24, 2013 5:13 pm

[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. :)

sarcastron
Posts: 1
Joined: Thu Sep 12, 2013 3:46 am

Re: Changing Locale Issue

Thu Sep 12, 2013 3:57 am

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:

Code: Select all

sudo dpkg-reconfigure locales
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.

rickx
Posts: 1
Joined: Fri Apr 04, 2014 7:27 pm

Re: Changing Locale Issue

Fri Apr 04, 2014 7:49 pm

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.

Code: Select all

locale -a
says

Code: Select all

C
C.UTF-8
POSIX
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.

User avatar
DougieLawson
Posts: 42635
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Changing Locale Issue

Fri Apr 04, 2014 9:42 pm

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
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.

diederik
Posts: 394
Joined: Wed Mar 26, 2014 11:17 pm

Re: Changing Locale Issue

Mon Apr 07, 2014 7:43 pm

rickx wrote:Mi rpi simply is unable to generate any locale. It reboots every time, whatever I tried before does not make any difference.
My guess is that you have a power(-supply) issue.
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.

chriswnl
Posts: 1
Joined: Wed Apr 16, 2014 2:24 pm

Re: Changing Locale Issue

Wed Apr 16, 2014 2:28 pm

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.

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: Changing Locale Issue

Wed Apr 16, 2014 9:26 pm

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.
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.

mob-i-l
Posts: 367
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden

Re: Changing Locale Issue

Sun Apr 27, 2014 8:36 am

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?
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/

User avatar
DougieLawson
Posts: 42635
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Changing Locale Issue

Sun Apr 27, 2014 10:27 am

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.

mob-i-l
Posts: 367
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden

Re: Changing Locale Issue

Sun Apr 27, 2014 11:37 am

DougieLawson wrote:Have you set your locale using sudo raspi-config?
Yes. All settings are US with UTF-8 except timezone that is Stockholm, Sweden.
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/

User avatar
DougieLawson
Posts: 42635
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Changing Locale Issue

Sun Apr 27, 2014 12:33 pm

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.

mob-i-l
Posts: 367
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden

Re: Changing Locale Issue

Sun Apr 27, 2014 3:07 pm

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?
Yes, I quoted part of my /etc/locale.gen file in my first post. I have used sudo locale-gen.
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/

mob-i-l
Posts: 367
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden

Re: Changing Locale Issue

Sun Apr 27, 2014 3:26 pm

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:

Code: Select all

perl -e exit
See http://stackoverflow.com/questions/2499 ... -from-perl
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/

User avatar
DougieLawson
Posts: 42635
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Changing Locale Issue

Sun Apr 27, 2014 8:42 pm

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.

mob-i-l
Posts: 367
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden

Re: Changing Locale Issue

Mon Apr 28, 2014 6:41 am

DougieLawson wrote:What do you have in /etc/ssh/ssh_config and /etc/ssh/sshd_config for your locale settings?
I have these but I have not changed these files manually:

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/

xerosis
Posts: 2
Joined: Tue May 20, 2014 5:35 pm

Re: Changing Locale Issue

Tue May 20, 2014 5:38 pm

I guess I'll jump on this thread, I'm having big problems with locales, namely:

Code: Select all

Generating locales (this might take a while)...
  en_GB.UTF-8...Killed
 done
Generation complete.
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?

diederik
Posts: 394
Joined: Wed Mar 26, 2014 11:17 pm

Re: Changing Locale Issue

Wed May 21, 2014 2:07 am

xerosis 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?
I haven't tried it myself, but you could try the suggestion from https://github.com/hifi/raspbian-ua-netinst#first-boot
Optional: Create a swap file with

Code: Select all

dd if=/dev/zero of=/swap bs=1M count=512 && mkswap /swap
(example is 512MB) and enable it on boot by appending

Code: Select all

/swap none swap sw 0 0
to /etc/fstab.

xerosis
Posts: 2
Joined: Tue May 20, 2014 5:35 pm

Re: Changing Locale Issue

Wed May 21, 2014 7:42 am

diederik wrote:
xerosis 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?
I haven't tried it myself, but you could try the suggestion from https://github.com/hifi/raspbian-ua-netinst#first-boot
Optional: Create a swap file with

Code: Select all

dd if=/dev/zero of=/swap bs=1M count=512 && mkswap /swap
(example is 512MB) and enable it on boot by appending

Code: Select all

/swap none swap sw 0 0
to /etc/fstab.
Thanks, I haven't tried that exact method but a similar one failed as there was no disk space on the sdcard left?

diederik
Posts: 394
Joined: Wed Mar 26, 2014 11:17 pm

Re: Changing Locale Issue

Wed May 21, 2014 7:59 am

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 ;-)

Return to “Raspberry Pi OS”