Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

pkg: Unable to set locale 'en_US.UTF-8'; locale package may be broken or not installed. Reverting

1313799Aug 17 2016 — edited Aug 19 2016

I have used the "exact-install" feature in sol11.3 to shrink down from the default entire package to the "solaris-minimal-server":

pkg exact-install --be-name Sol11.3 entire@0.5.11,5.11-0.175.3.1.0.5 solaris-minimal-server

I have activated the new BE and rebooted but now I get the following error with each command:

root@SERVERH:~# pkg list group/system/\*

pkg: Unable to set locale 'en_US.UTF-8'; locale package may be broken or

not installed.  Reverting to C locale.

NAME (PUBLISHER)                                  VERSION                    IFO

group/system/solaris-core-platform                0.5.11-0.175.3.0.0.30.0    i--

group/system/solaris-minimal-server               0.5.11-0.175.3.1.0.5.0     i--

root@SERVER:~#

How do I install what's missing or what to do to get rid of the error message? I have tried activating the change-facet locale.en_US=True but that didn't do anything.

Thank you.

This post has been answered by Rmanus-Oracle on Aug 19 2016
Jump to Answer

Comments

Pascal Kreyer-Oracle

Please check that "system/locale" package and "system/locale/en_us" are installed.

Ingeb-Oracle

In case you dont want to add more packages you can get rid of the error message by using the C locale.

Set LANG=C and verify what else you have in your locale environment, use "locale" command.

1313799

root@<Server>:~# pkg list -a system/locale

pkg: Unable to set locale 'en_US.UTF-8'; locale package may be broken or

not installed.  Reverting to C locale.

NAME (PUBLISHER)                                  VERSION                    IFO

system/locale                                     0.5.11-0.175.3.0.0.26.2    ---

root@<Server>:~# pkg list -a system/locale/en_us

pkg: Unable to set locale 'en_US.UTF-8'; locale package may be broken or

not installed.  Reverting to C locale.

pkg list: no packages matching 'system/locale/en_us' allowed by installed incorporations, or image variants that are known or installed

Use -af to allow all versions.

root@<Server>:~#

1313799

For locale I have:

LANG=en_US.UTF-8

LC_CTYPE="C"

LC_NUMERIC="C"

LC_TIME="C"

LC_COLLATE="C"

LC_MONETARY="C"

LC_MESSAGES="C"

LC_ALL=

Would I have any issues running on C locale for all above?

Edit: I've set the environment/LANG to C using the following cmd:

     svccfg -s environment:init setprop environment/LANG = astring: C

and checking the SMF property I get the right value:

     svccfg -s svc:/system/environment:init listprop environment/LANG

     environment/LANG astring     C

but with locale cmd there is no difference:

     root@H<Server>:~# locale

     LANG=en_US.UTF-8

     LC_CTYPE="C"

     LC_NUMERIC="C"

     LC_TIME="C"

     LC_COLLATE="C"

     LC_MONETARY="C"

     LC_MESSAGES="C"

     LC_ALL=

     root@<Server>:~#

And I still get the same error. So this LANG=en_US.UTF-8 must be set someplace else in SMF?

Rmanus-Oracle
Answer

The 'en_US.UTF-8' is delivered by the system/locale package that is not installed on your system.

So, to fix the problem either install the missing package or change your LANG env. variable to 'C'.

-- Renaud

Marked as Answer by 1313799 · Sep 27 2020
1313799

Hi Renaud,

I answered above some of the issues I have encountered.

Having not found the right setting to fall-back to C for the LANG variable,  I have made a /etc FS-wide search for the string and fount these:

root@<Server>:~# find /etc -type f|xargs grep "en_US.UTF-8"

/etc/svc/profile/site/sc_profile.xml:        <propval type="astring" name="LANG" value="en_US.UTF-8"/>

/etc/svc/profile/sysconfig/sysconfig-20160804-231234/sc_profile.xml:        <propval type="astring" name="LANG" value="en_US.UTF-8"/>

/etc/svc/profile/sysconfig/sysconfig-20160804-231234/svc:_system_environment:init-backup:        <propval name='LANG' type='astring' value='en_US.UTF-8'/>

/etc/svc/profile/sysconfig/sysconfig-20160811-064501/svc:_system_environment:init-backup:        <propval name='LANG' type='astring' value='en_US.UTF-8'/>

Could they be a clue in what direction to go to get rid of that error?

Rmanus-Oracle

From init(1M) man page

   init and System Booting

       When  the  system  is booted, init is invoked and the following occurs.

       First, it reads the  properties  for  the  svc:/system/environment:init

       service.  Among these properties are values for locale-related environ-

       ments, such as LANG or LC_CTYPE.

So you need to reboot the system for the change to apply system-wide

1313799

Yes I already did that and it did the trick. Strange that even Oracle suggests refreshing the SMF service after setting the locale (https://docs.oracle.com/cd/E36784_01/html/E36823/glmec.html ). That might be only to see if the value was updated but they should mention that it will take effect after reboot.

After first reboot I got a dozen lines about "failed to set locale" as the system started rebooting but after reboot it was gone.

Now what should I expect in terms of differences in operations to the en_US.UTF-8?

Thanks.

Alta-Oracle

Note that you have given a link to the 11.2 documentation. The 11.3 documentation is different:

Working with Languages and Locales - International Language Environments Guide for Oracle® Solaris 11.3

1 - 10
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 16 2016
Added on Aug 17 2016
10 comments
3,530 views