DNF or yum output error "Failed to set locale, defaulting to C.UTF-8" on RHEL 8

Solution Verified - Updated -

Issue

  • dnf or yum commands works, but it shows the following errors in English environments:

    # locale
    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
    
    # yum update
    Failed to set locale, defaulting to C.UTF-8
    
    # dnf update
    Failed to set locale, defaulting to C.UTF-8
    

Environment

  • Red Hat Enterprise Linux
    • 8.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content