Update Manager can't set LC_MESSAGES to default locale

Bug #1023421 reported by MadhuSoodanan
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

When I try to Update Ubuntu I always see the following lines moving up. These lines appear (when I click on 'Details') frequently while updating. I wish to know whether it is an internal error. Need I do anything? I doubt my question about sending Emails by Thunderbird (Not solved yet; but now removed from my launchpad 'answers') is a side effect of this.

The repeating lines are these:
---------------------------------------------------
locale: Cannot set LC_CTYPE to default locale: No such file or directory
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
--------------------------------------------------
Should I ignore all these?

Tags: xenial
Revision history for this message
MadhuSoodanan (mt-madhu) wrote :

I doubt this problem was there in old versions of Ubuntu. When I run terminal command I got the following reply

rm: cannot remove `/var/lib/apt/lists/lock': No such file or directory.

Revision history for this message
MadhuSoodanan (mt-madhu) wrote :

It is sure.......I can't see any 'lock' in /lists/........The only folder in 'lists' is an empty 'partial' folder.

Revision history for this message
MadhuSoodanan (mt-madhu) wrote :

What should I do next

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

I suspect that <http://askubuntu.com/q/759795> is related. In that case LANG is set to "en_IN", which is a perfectly valid name of the English/India UTF-8 locale.

$ cat /usr/share/i18n/SUPPORTED | grep en_IN
en_IN UTF-8

Changing LANG to "en_IN.UTF-8" makes the error messages go away.

So there seems to be an incorrect locale validity test somewhere in the code.

Changed in update-manager (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

This bug is still present in Xenial, version 1:16.04.3.

tags: added: xenial
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :
Revision history for this message
dg1727 (dg1727) wrote :

I'm having the problem, or a similar one, on Linux Mint 18.1 Serena XFCE, which is based on Xenial.

My version of this problem affects many programs, not just update-manager:

man: can't set the locale; make sure $LC_* and $LANG are correct

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
 LANGUAGE = (unset),
 LC_ALL = (unset),
 LANG = "en_US"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

"pip" doesn't run at all. locale.Error: unsupported locale setting

So I did: (% is the shell prompt)

% locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
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
LANG=en_US
LANGUAGE=
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=
% grep en_US /usr/share/i18n/SUPPORTED
en_US.UTF-8 UTF-8
en_US ISO-8859-1
en_US.ISO-8859-15 ISO-8859-15
% LANG=en_US.UTF-8
% man {some program}
# Now the error message isn't displayed! -- and likewise in programs that use Perl.

I'm having the issue with en_US (no other locale has ever been selected in this OS install), *not* one of the locales mentioned in the linked bug-report https://bugs.python.org/issue20087

I was getting the same error messages in Linux Mint Debian Edition 2 "Betsy", which is based on Debian stable/jessie. I can do a little more testing on that OS install if it's relevant to this bug report.

I searched on Launchpad for similar issues, but this one I'm commenting in is the closest one I've found.

Of course, I can put a file in /etc/profile.d/ to set LANG=en_US.UTF-8 when anyone logs in, but I hope a bug report has been, or will be, filed against the relevant package.

Please let me know if there is a more appropriate bug report I should monitor and/or comment in.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

@dg1727: I don't think you encountered a bug at all; you just have set an incorrect locale name. "en_US" isn't generated by default, and if it is present, it enables latin1 encoding, which you probably not want. Just update /etc/default/locale by running this command:

sudo update-locale LANG=en_US.UTF-8

Revision history for this message
dg1727 (dg1727) wrote :

In my case, the problem was a file ~/.dmrc which was as follows:

[Desktop]
Language=en_US
Langlist=en_US:en
LCMess=en_US.UTF-8
Layout=us
Session=xfce

Deleting that .dmrc file fixed the issue.

Neither the user of this user account, nor the admin user, has ever explicitly set a locale to en_US. So apparently there was a bug in a previous software version that produced the "en_US". (The same /home partition is being used as when a previous distro was running on the machine.)

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

@dg1727: I see. Good that you figured it out.

The entries in that ~/.dmrc file might have been set by a very old version of GDM. So yes, it may be some kind of old transition bug between different versions and/or different display managers. I'd suggest that we leave it at that.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.