[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 read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
dg1727

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

Post by dg1727 »

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 LockBot on Wed Dec 28, 2022 7:16 am, edited 4 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
George99

Re: After install, LC_ALL is unset

Post by George99 »

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 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: After install, LC_ALL is unset

Post by Flemur »

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

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

Post by dg1727 »

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

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

Post by dg1727 »

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

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

Post by George99 »

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

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

Post by dg1727 »

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

Return to “Installation & Boot”