I am getting the following errors when I execute some commands on Solaris 10.

couldn't set locale correctly

Output of locale command-


Does LC_ALL need to be set? I don't have root on this machine.. can I specify locale in my rc files?

  • Which commands? – Dennis Williamson Sep 16 '09 at 15:09
  • Running a perl script – badkya Sep 16 '09 at 16:18
  • So is this any Perl script or just one? If the latter, can you post the part of your script that is causing the error? LC_ALL is used for overriding the other settings. – Dennis Williamson Sep 16 '09 at 18:10
  • Do not set both LC_ALL and the other LC_ variables. Either unset LC_ALL, or set it to a valid value and unset the others. – mark4o Sep 17 '09 at 13:57
  • I see... this shows up intermittently... I cannot seem to find a trend.. I'll hunt for the next instance of this error and try to find more about the command causing the error – badkya Sep 17 '09 at 22:21

Locale settings are done via environment variables - you don't need to edit system files unless you want to change the defaults for every process on the system. The locale(5) and environ(5) man pages have more details on the various variables that affect locale settings.

locale -a will show the installed locales so you can make sure you've set it to one that's actually there.


You can use localeadm to install additional locales.


I suspect your Solaris installation is missing packages with locales. Try doing a full OS installation and then setting the locale.


locale -a gives you the list of installed locales. I believe that list doesn't contain en_US entry, so try setting LANG to "C" as well, or override it with setting LC_ALL to "C"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy