$LANG is defined in 2 places: /etc/environment and /etc/default/locale

Bug #77983 reported by RichardNeill
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Debian
New
Undecided
Unassigned
belocs-locales-bin (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

In order to change $LANG system-wide, it's necessary to modify both /etc/environment, and /etc/default/locale. This is undocumented, and confusing.

Also, it seems that the definition in /etc/default/locale takes effect second, thus overwriting the value from /etc/environment. Shouldn't this be the other way around? Or defined in one place only? Or at least commented?

I've added a section on Locale Variables to the wiki here, so when this bug is fixed, please update:
  https://wiki.ubuntu.com/environment_variables

Perhaps also relevant:
   1) Thunderbird uses $LANG rather than the installed language (which is already available as United Kingdom) to determine how it displays dates.

   2)None of the usual environment variables are present in the shell. These are present on my Mandriva systems, but absent on Ubuntu - it could be an error, or it could be by design - I don't know, so I'm adding it for completeness:
$LC_ADDRESS $LC_CTYPE $LC_MEASUREMENT $LC_MONETARY $LC_NUMERIC $LC_SOURCED $LC_TIME
$LC_COLLATE $LC_IDENTIFICATION $LC_MESSAGES $LC_NAME $LC_PAPER $LC_TELEPHONE

  3)Why is it necessary to log out and back in for this to take effect? Shouldn't launching another bash shell (Konsole -> new tab) be sufficient for the change in environment to apply?

Revision history for this message
Marcelo de G. Malheiros (mgm) wrote :

Found the same problem here, where we are used to setup boxes to work with ISO-8859-1 for interoperability with older systems.

The location at '/etc/default/locale' seems to be more adequate as the standard one.

Revision history for this message
Clive Darra (osde8info) wrote :

on a pure debian system /etc/default/locale seems to overide /etc/environment

what is the equivalent of update-locale on ubuntu

Revision history for this message
Andres Mujica (andres.mujica) wrote :

To be honest this is a tough one, i'm not pretty sure if it's an enhancement request or a misconfiguration or a real bug.

I'm assigning this package to PAM as suggested at the IRC channel.

andres@gutsy:~$ dpkg -S /etc/environment
dpkg: /etc/environment not found.
andres@gutsy:~$ dpkg -S /etc/default/locale dpkg: /etc/default/locale not found.
andres@gutsy:~$ ls -l /etc/default/locale

andres@dapper:~$ dpkg -S /etc/default/locale
dpkg: /etc/default/locale not found.
andres@dapper:~$ dpkg -S /etc/environment
dpkg: /etc/environment not found.

Changed in pam:
assignee: andres-mujica → nobody
Revision history for this message
wolfger (wolfger) wrote :

Not seeing why this was set to "incomplete" on Ubuntu.
# If you have to ask the reporter questions, set the bug to Incomplete
# Ask the submitter to provide any necessary information in a comment, and make sure you subscribe yourself to the bug report so you will get any updates to the bug via e-mail.
# In the event that a bug has been in the "Incomplete" state for more than 4 weeks, meaning it has not received a response to a request for more information, the bug status should be changed to "Invalid"

I am setting the status to "confirmed" since two users have reported having the problem, and there is no pending request for information.

Changed in pam:
status: Incomplete → Confirmed
Revision history for this message
Henning Moll (drscott) wrote :

Here's a short excerpt from Bug #160984:

> Interesting part from /usr/share/doc/belocs-locales-bin/NEWS.Debian.gz:
>> * Locale variables are now stored in /etc/default/locale and no more
>> /etc/environment. The reason is that Debian Policy forbids modifying
>> configuration files of other packages, and /etc/environment is a
>> configuration file for PAM.

Revision history for this message
Steve Langasek (vorlon) wrote :

although /etc/environment is a PAM config file, the pam package has never written to it. Cleaning up the old LANG entry should be handled by whatever package added it in the first place, which I think is belocs-locales-bin; reassigning.

Revision history for this message
Andres Mujica (andres.mujica) wrote :

this is solved in hardy.

https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/160984/comments/9

so i'm marking this bug as duplicate of bug #160984

don't hesitate in reopening again if you feel it's needed.

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.