Cannot Set to Default Locale

On my Debian machine I kept getting the following error messages when using sudo aptitude safe-upgrade

perl: warning: Falling back to the standard locale (“C”).
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

There are many solutions but the one that worked for me came from a Debian bug report: apt-get update fails to get index package list and therefore does nothing. If you have the locales package installed, you should run the following:

sudo dpkg-reconfigure locales

I generated all locales, even if I did not need them right then. I also chose en_US.UTF-8 as my default locale. If running dpkg-reconfigure gives you errors, it may mean that you do not have the locales package installed. To install it, run the following

sudo aptitude install locales

It will also ask you which locales you want to generate and which one you want to use as default.

I want to thank all the pages which helped me understand the problem before I could fix it: locale: Cannot Set LC_ALL to default locale: No such file or directory; I keep getting this weird error; locale: Cannot set LC_ALL to default locale: No such file or directory; Ubuntu perl locale errors.

3 Responses to Cannot Set to Default Locale

  1. niku says:

    thanks.

  2. Poilou says:

    Thx ! ;)

  3. Steve says:

    thanks man saved me

%d bloggers like this: