Skip to content
Luca Dell'Oca Principal Cloud Architect @Veeam
Virtual To The Core Virtual To The Core

Virtualization blog, the italian way.

  • Media
  • About me
Virtual To The Core
Virtual To The Core

Virtualization blog, the italian way.

Quick tip: adjust locale settings on CentOS 7 minimal install

Luca Dell'Oca, January 15, 2015December 4, 2016

I’m playing lately with the new CentOS 7. As usual, I prefer to run the minimal install to keep the disk usage at a minimum, and avoid a system loaded with software and services I don’t need. I’m not sure if it’s because of the minimum install mode, but with CentOS 7, as soon as a new system is installed and I run yum, I’m facing everytime this annoying warning message:

Failed to set locale, defaulting to C

So, I figured out a quick way to change the locale settings in CentOS 7.

You just need to create a new configuration file like:

vi /etc/profile.d/locale.sh

In this new file, enter the needed parameters like mine in this case:

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

Save the file, and load its parameters using:

source /etc/profile.d/locale.sh

I’ve read around someone is suggesting to edit /etc/bashrc. This is a BAD thing to do, this file can be updated from time to time when updating the system, and I’m not sure a non-default file is not dangerous. Profile.d is your place to go.

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to email a link to a friend (Opens in new window) Email
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
Tech 7.0centosfailedlinuxlocaleprofile.dset

Post navigation

Previous post
Next post

Search

Sponsors

Latest Posts

  • Migrate WSL (Windows Subsystem for Linux) to a new computer
  • Pass keystrokes to a pfSense virtual machine to install it automatically
  • Automatically deploy pfSense with Terraform and Ansible
  • My Automated Lab project: #6 Create a S3 Bucket with Terraform
  • My Automated Lab project: #5 Deploy a Linux vSphere VM with Terraform and custom disks
©2025 Virtual To The Core | WordPress Theme by SuperbThemes
We use cookies to ensure that we give you the best experience on our website, and to collect anonymous data regarding navigations stats using 3rd party plugins; they all adhere to the EU Privacy Laws. If you continue to use this site we will assume that you are ok with it.OkNoPrivacy Policy