Skip to main content

Fix “Failed to set locale"

Locale

A locale is a set of basic system parameters that define things such as a user’s language, region and any special variant preferences that the user wants to see in their user interface.
On POSIX platforms such as Linux and other Unix-like operating systems, locale identifiers are defined by ISO/IEC 15897. For example, UNITED STATES OF AMERICA (US) English using the UTF-8 encoding is en_US.UTF-8.

Issue

“Failed to set locale, defaulting to C.UTF-8”

Solution

Check the system locale

localectl

Set system locale to English US

dnf install glibc-langpack-en
localectl set-locale LANG=en_US.UTF-8

Check the system locale post implementation

tipu@tipu-dev-machine:~$ localectl
System Locale: LANG=en_US.UTF-8
VC Keymap: (unset)
X11 Layout: us
X11 Model: pc105