[SOLVED] After install, programs give errors like "can't set the locale"

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
dg1727
Level 1
Level 1
Posts: 24
Joined: Mon Sep 22, 2014 4:08 pm

[SOLVED] After install, programs give errors like "can't set the locale"

Post by dg1727 » Mon Mar 06, 2017 8:55 am

Linux Mint 18.1 Serena XFCE, recent install (/home is pre-existing from an earlier distro).

Same issue as in https://github.com/linuxmint/live-installer/issues/80 (that issue was with Linux Mint Debian Edition).
I wrote: I selected an English (US) locale and the default 105-key keyboard. I don't remember doing anything out of the ordinary in the installer. This machine is dual-boot with an older Linux distro, no Windows.
Now environment variable LC_ALL is unset, which causes error messages in several programs, such as:
  • The nemo-compare extension fails
  • The "man" program says can't set the locale; make sure $LC_* and $LANG are correct
LANG is set to en_US
This issue prevents "pip" from running.

Per viewtopic.php?f=46&t=233956&p=1242073#p1242073 I opened the Languages control panel on Serena.
The buttons for "Language" and "Region" both say en_US. Under "System locale" (next to the button for "Apply System-Wide") it says:

Code: Select all

Language:  English, United States
Region:  No locale defined
Before I click "Apply System-Wide," I'd like to find out why LC_ALL is unset in the first place, so this problem hopefully won't happen at all for future users.

Attempts to help will be appreciated.

Edit: Changed the title. Per comments below, the problem isn't that LC_ALL is unset, but that LANG is set to "en_US" instead of "en_US.UTF-8".
Last edited by dg1727 on Wed Mar 08, 2017 1:58 pm, edited 3 times in total.
--dg1727

George99
Level 3
Level 3
Posts: 106
Joined: Sun Aug 10, 2014 10:59 am

Re: After install, LC_ALL is unset

Post by George99 » Mon Mar 06, 2017 9:30 am

Open a terminal and try

Code: Select all

sudo dpkg-reconfigure locales
Choose

Code: Select all

[*] en_US.UTF-8 UTF-8
No other locale should be marked

Reboot and verify with

Code: Select all

locale
LC_ALL should be unset, that's OK.

User avatar
Flemur
Level 17
Level 17
Posts: 7330
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: After install, LC_ALL is unset

Post by Flemur » Mon Mar 06, 2017 1:04 pm

If better methods don't work, you can define it in your ~/.bashrc file

Code: Select all

export LC_ALL="C"
Note: I set everything to "C" to fix a bug in thunar where it sorts filenames incorrectly** (so set it to whatever value you think is correct):

Code: Select all

$ locale
LANG=C
LANGUAGE=
LC_CTYPE="C"
...
LC_IDENTIFICATION="C"
LC_ALL=C
**filenames with characters like _ - and such don't sort properly otherwise; just changing "LC_COLLATE" didn't fix it.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

dg1727
Level 1
Level 1
Posts: 24
Joined: Mon Sep 22, 2014 4:08 pm

Programs give errors like "can't set the locale"

Post by dg1727 » Mon Mar 06, 2017 9:56 pm

Thanks to both for your replies. As noted,
I wrote:I'd like to find out why [this issue occurred] in the first place, so this problem hopefully won't happen at all for future users.
Because of George99's statement about LC_ALL, I've changed the title of this posting.

I've filed comment https://bugs.launchpad.net/ubuntu/+sour ... comments/7
As noted in that comment, setting environment variable LANG to en_US.UTF-8 stops the error messages.

I'll be interested to know if there is anything more specific to Linux Mint that I should do about whatever software component may have introduced this error.
--dg1727

dg1727
Level 1
Level 1
Posts: 24
Joined: Mon Sep 22, 2014 4:08 pm

Re: After install, programs give errors like "can't set the locale"

Post by dg1727 » Tue Mar 07, 2017 1:53 pm

https://github.com/linuxmint/live-installer/issues/80 updated, incl. response from Launchpad.net
--dg1727

George99
Level 3
Level 3
Posts: 106
Joined: Sun Aug 10, 2014 10:59 am

Re: After install, programs give errors like "can't set the locale"

Post by George99 » Wed Mar 08, 2017 11:03 am

For curiousity I just installed Mint 18.1 XFCE 32bit in a VM choosing english / english(US) and "New York" as location.

So this is what I got:
VirtualBox_xfce_08_03_2017_16_00_40.png
locale defaults to en_US.UTF-8, not en_US...

dg1727
Level 1
Level 1
Posts: 24
Joined: Mon Sep 22, 2014 4:08 pm

Re: After install, programs give errors like "can't set the locale"

Post by dg1727 » Wed Mar 08, 2017 1:58 pm

Yes, I've also done similarly and got the same result. The problem followed the existing /home partition.

The cause turned out to be a file called .dmrc in the primary user's home folder:

Code: Select all

[Desktop]
Language=en_US
Langlist=en_US:en
LCMess=en_US.UTF-8
Layout=us
Session=xfce
Deleting that .dmrc file fixed the issue. :-)

Thanks to all for bearing with me on this.
--dg1727

Post Reply

Return to “Installation & Boot”