brasskey
Posts: 2
Joined: Thu Jan 11, 2018 2:34 am

Issue with locale - Cannot set LANGUAGE and LC_ALL

Thu Jan 11, 2018 4:51 am

I am a newbie, but have been browsing this issue for hours with no idea on how to fix. When I go to Terminal and type the "locale" command, below is what I see:

[email protected]:~ $ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=


I saw a post suggesting going to raspi-config and setting through there. I can select the en_US.UTF-8 and apply, but LANGUAGE and LC_ALL are still not set.


Next, I various forum posts suggesting these steps:


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 localeslocale-gen en_US.UTF-8


When I try the locale-gen en_US.UTF-8 command, I get the error below. Is that part of the reason I can't fix my issue?


rm: cannot remove '/usr/lib/locale/locale-archive': Permission denied
Generating locales (this might take a while)...
en_GB.UTF-8...cannot open locale archive "/usr/lib/locale/locale-archive": Permission denied
done
en_US.UTF-8...cannot open locale archive "/usr/lib/locale/locale-archive": Permission denied
done
Generation complete.

klricks
Posts: 6375
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Issue with locale - Cannot set LANGUAGE and LC_ALL

Fri Jan 12, 2018 3:03 am

brasskey wrote:
Thu Jan 11, 2018 4:51 am
.....

I saw a post suggesting going to raspi-config and setting through there. I can select the en_US.UTF-8 and apply, but LANGUAGE and LC_ALL are still not set.
That is normal. What are you expecting?
brasskey wrote:
Thu Jan 11, 2018 4:51 am

....
When I try the locale-gen en_US.UTF-8 command, I get the error below. Is that part of the reason I can't fix my issue?

....
Any command or script that modifies system files must be preceded with sudo.

Code: Select all

sudo locale-gen en_US.UTF-8
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

brasskey
Posts: 2
Joined: Thu Jan 11, 2018 2:34 am

Re: Issue with locale - Cannot set LANGUAGE and LC_ALL

Fri Jan 12, 2018 3:37 am

That is normal. What are you expecting?

I was expecting to set LANGUAGE and LC_ALL.


Any command or script that modifies system files must be preceded with sudo.

Thank you! That was my problem.

Return to “Raspbian”