I've got a locale problem.
The collating sequence in nautilus
and other programs has changed.
I get locale errors appearing in the terminal when I launch a GUI app..
Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
The locale
command produces error messages
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_AU
LANGUAGE=en_AU:en
LC_CTYPE="en_AU"
LC_NUMERIC="en_AU"
LC_TIME="en_AU"
LC_COLLATE=en_AU.UTF-8
LC_MONETARY="en_AU"
LC_MESSAGES=en_AU.UTF-8
LC_PAPER="en_AU"
LC_NAME="en_AU"
LC_ADDRESS="en_AU"
LC_TELEPHONE="en_AU"
LC_MEASUREMENT="en_AU"
LC_IDENTIFICATION="en_AU"
LC_ALL=
As suggested in askubuntu question, I've run the following commands, but there was no change.
sudo apt-get install language-pack-en-base
sudo dpkg-reconfigure locales
I also tried the suggestion in askubuntu question... also no change.
apt-get install --reinstall locales
I think it began when I temporarily installed and uninstalled the Urdu language Input Method Editor via IBus
.. it certainly happened on the same day.
Maybe it is IBus related, but I've not had any problems with it before this.
- The OS is 10.04
I've managed to get things running "normally" again.
After trying lots of package re-installs etc, including fully removing IBus (all to no effect), I started to think that it may be caused by a config setting which re-installing doesn't modify.
I had noticed that the output from
locale
was rather bereft, of UTF-8 assignments, so I checked this in a recently installed VM... all entries of LC_* (except LC_ALL, which overrides all the others) were set with the.UTF-8
suffix. so I manually set the LC_* values as shown below.I probably could have just used
LC_ALL="en_AU.UTF-8"
, but in reading up about this, I've discovered how to customize the system date and time format, andLC_ALL
would override my custom setting.I don't know if I've used the most appropriate method, but it works!
The modified file is:
/etc/default/locale
This shows the contents before the mod:
This shows the contents after the mod:
The same file in the VM contained only this one line:
Redefining the locales and reconfiguring might be sufficient to fix the problem:
When you run
sudo dpkg-reconfigure locales
you can select the locale you want by clicking on spacebar and moving with ↑ and ↓ before hitting Enter.I also met this problem ,as you see, your
LC_ALL
is empty. I did as follows and it helps:and set the
LC_ALL
to something likeen_US.UTF-8
,mine is:then reboot,and run
locale
,and it should be something like:If you are remotely connected to the machine over ssh (eg from a macosx device) you need to set these variables on the machine you are connecting from
add the following to ~/.bash_profile
I just want to add, that I needed to edit my home profile too:
So in your case it would look like:
Log out + Log in. And all is as expected.
I had the same problem for several months, a lot of software tools warned about broken locale settings, and some even refused to run. I want to use English language, but Swedish monetary and number settings.
What finally worked for me was to edit
/etc/default/locale
where I removed everything in that file. I then started the Unity language setup(Settings -> Language Support)
, set everything up (Ubuntu wanted to install some missing components) and pressed"Apply System-wide"
when I was done.My
/etc/default/locale
now looks like this.The big difference between this and my original file is
LANGUAGE="en"
.It's been a while since this was posted but recently I had problems with "locale" variables and no answer gave me any results. Maybe my own experience could help someone else.
My LANG variable was empty, and this was giving me problems.
Output:
I tried some of the commands like:
With no success. I tried editing the /etc/default/locale and find out it was already O.K:
Output:
Also my .pam_environment file seemed to be right:
Output:
I din't want to add extra stuff to profile or bash files, mainly because although it could solve the problem I wouldn't know the cause, and that annoyed me.
Finally I wondered if something was already overriding "locale" variables and I ran the next command:
Output:
So I found two lines on my .bashrc file that where the cause (I'm not pasting the whole file):
I don't know how or when those lines ended up on my bash file, but I'm completely sure I didn't write them, maybe my .bashrc was replaced when I was working with some web-development stuff, I really don't know, but since I know this was unintentional and there are people out there with no clue about what's causing "locale" misbehavior, maybe this could help them. Anyway commenting those lines and a reboot solved the problem for me. Here I answered the same question focused on sublimeT3 complaints about the LANG variable.
Seems an update fried locales somehow. The fix I found was to log out, change the language selected before logging in, and logging in again.
It might also help to reinstall the locales in synaptic, though I cannot confirm that this is what fixed it for me, I think it was logging out or something.
I tried editing locale file and choosing different languages at login.
Filtering for broken packages with Synaptic and completely removing the 9 offending packages worked for me (libreoffice and python uno).
But, I am unable to install LibreOffice without apparently corrupting the package manager. It does, however, install.
I'm on 11.04 i386. Disclaimer: There was a power failure during the last part of my installation as Ubuntu was downloading updates.
I had the same problem but going to System > Administration > Language Support may solve your problem because it may ask you to install some packages and then it will be fine!! It worked for me so i guess it'll do the same to you!!