Handling Locale Error Messages in Ubuntu

Posted on 6:52 PM by Bharathvn

If you are working at the command line with Ubuntu (Feisty Fawn), you may see a
locale error messages like one of these while trying to install packages:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
locale: Cannot set LC_CTYPE to default locale: No such file or directory

This seems to be a problem related to the installed language settings, or something
with internationalized encoding in general. One workaround you can use to keep things satisfied is to export the LC_ALL environment variable and set it the same as
your LANG setting.

$ export LC_ALL=”$LANG”

There are several other possible workarounds on the help sites, but this one will be the easiest to undo in case the cure causes more problems than the condition. It should also work regardless of what language you speak. Note that you will have to run this command every time you open a local or ssh shell. You can automate this task by placing the command in your ~/.bashrc file.