Configure language, character encoding, and time settings for your system.
Show current timezone:
timedatectl
List available timezones:
timedatectl list-timezones timedatectl list-timezones | grep America
Set timezone:
sudo timedatectl set-timezone America/New_York sudo timedatectl set-timezone Europe/London sudo timedatectl set-timezone UTC
Or manually:
sudo ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
Check timezone file:
cat /etc/timezone
Enable network time sync (NTP):
sudo timedatectl set-ntp true
Show sync status:
timedatectl
Manually set time:
sudo timedatectl set-time "2024-01-15 14:30:00"
Show current locale:
locale
List available locales:
locale -a
Set system locale:
sudo update-locale LANG=en_US.UTF-8 sudo update-locale LC_TIME=en_GB.UTF-8
Reconfigure locales:
sudo dpkg-reconfigure locales
Then select locales to generate. Changes take effect after logout/login.
Show current:
setxkbmap -query
Set temporarily:
sudo loadkeys us
Persistent configuration:
sudo dpkg-reconfigure keyboard-configuration
Then restart:
sudo systemctl restart keyboard-setup
LANG — default languageLC_TIME — date/time formatLC_NUMERIC — number format (. vs ,)LC_MONETARY — currency symbolsLC_COLLATE — sorting orderLC_CTYPE — character classificationLC_MESSAGES — error messagesLC_PAPER — paper size (A4, Letter)Each can be set independently:
export LC_TIME=de_DE.UTF-8 date # shows German date format
en_US.UTF-8 — US English, UTF-8en_GB.UTF-8 — British Englishde_DE.UTF-8 — Germanfr_FR.UTF-8 — Frenchja_JP.UTF-8 — JapaneseC.UTF-8 — POSIX locale (useful for scripts)Most modern systems use UTF-8; avoid older encodings (ISO-8859-1, etc.).
C.UTF-8 or en_US.UTF-8ls, collation in databases