#!/bin/bash

Update /etc/sysconfig/language to set RC_LANG to en_GB.UTF-8

sudo sed -i ‘s/^RC_LANG=.*/RC_LANG=”en_GB.UTF-8”/’ /etc/sysconfig/language ||
echo ‘RC_LANG=”en_GB.UTF-8”’ | sudo tee /etc/sysconfig/language

Use localectl to set the system locale

sudo localectl set-locale LANG=en_GB.UTF-8

Export locale for the current session

export LANG=”en_GB.UTF-8”

Display the new locale setting

echo “Locale has been set to: $LANG”

Optionally, if you want to update your shell initialisation file,

you can append the following line to your ~/.bashrc:

echo ‘export LANG=”en_GB.UTF-8”’ » ~/.bashrc

Inform the user that a logout/login or reboot is recommended for system-wide changes to take effect.

echo “Please log out and back in (or reboot) to apply the changes system-wide.”

Updated: