[CentOS] Yum on CentOS 8: Failed to set locale, defaulting to C

Mon Dec 16 13:25:34 UTC 2019
Nicolas Kovacs <info at microlinux.fr>

Hi,

I'm currently fiddling with CentOS 8.0 on a sandbox server in order to get
acquainted with its various quirks and idiosyncrasies.

Here's the first curious detail I noticed.

I used the CentOS installer in french (since I live in France), but I like my
server systems to default to english. (If you've ever read one of these funny
"frengrish" SELinux alerts, you'll understand why. Anyway.)

After the installation, I ran this:

  # localectl set-locale LANG=en_US.UTF8

So here's what I have actually on my minimal system:

  $ localectl
     System Locale: LANG=en_US.UTF8
         VC Keymap: ch-fr
        X11 Layout: ch
       X11 Variant: fr

But my initial user still has system messages in french, so I added this to his
~/.bashrc:

# LANG
LANG=en_US.UTF8
export LANG

I logged out and logged back in and tried the 'yum check-update' command, which
normally doesn't require root privileges. And here's what I get:

  $ yum check-update
  Failed to set locale, defaulting to C
  Last metadata expiration check: 0:17:42 ago on Mon Dec 16
  14:04:39 2019.

Any idea on how to make Yum behave here?

Cheers,

Niki
-- 
Microlinux - Solutions informatiques durables
7, place de l'église - 30730 Montpezat
Site : https://www.microlinux.fr
Mail : info at microlinux.fr
Tél. : 04 66 63 10 32
Mob. : 06 51 80 12 12