Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Fix “Failed to set locale, defaulting to C.UTF-8” in CentOS 8 - DesignLinux

May 29 2020
designlinux 0 Comments

Have you ever encountered the warning/error “Failed to set locale, defaulting to C.UTF-8” in CentOS 8 or RHEL 8? If yes, then this article describes how to fix this error. Note that this article should also work on any operating systems based on RHEL 8.

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.

Recommended Read: How to Change or Set System Locales in Linux

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).

The following is a screenshot showing the warning/error when you run the dnf or yum command as shown.

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

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

To set system locale, use the localectl command. For example, if you want English – UNITED STATES OF AMERICA (US) using the UTF-8 encoding, run the following command.

# localectl set-locale LANG=en_US.UTF-8

Next, check if the system locale has been set by running the following command.

# localectl
# dnf install @postgresql
Failed to set locale, defaulting to C.UTF-8

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

Note that even after setting the system locale, the warning persists. This implies that the language packs are missing. To install them, go to the next section.

If a particular language pack is missing on your system, you need to install it to fix the above error. However, you can install all language packs provided by the glibc-all-langpacks package which contains all locales.

# dnf install langpacks-en glibc-all-langpacks -y
Install Language Packs in CentOS 8

Install Language Packs in CentOS 8

Alternatively, if you want to install locales individually, and thus have a smaller package installation footprint on your system, run the following command (replace en with the locale-code you want).

# dnf install glibc-langpack-en

Using the above procedure, we managed to fix the “Failed to set locale, defaulting to C.UTF-8” in CentOS 8 or RHEL 8. Hoping that this worked for you as well, otherwise. give us feedback via the comment form below.

Sharing is Caring…
Share on FacebookShare on TwitterShare on LinkedinShare on Reddit

Related

Tags: CentOS Tips, RHEL Tips

How to Install and Configure an NFS Server on Ubuntu 18.04

Prev Post

Zaloha.sh – A Simple Local Directory Synchronizer Script for Linux

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 85
  • 609,444

DesignLinux.com © All rights reserved

Go to mobile version