$linuxjunkies
>

localectl(1)

Control the system locale and keyboard layout settings.

UbuntuDebianFedoraArch

Synopsis

localectl [OPTIONS...] {COMMAND}

Description

localectl is a command-line utility for querying and changing the system locale and keyboard layout on systemd systems. It manages locale variables (language, character encoding, date/time format) and X11/console keyboard layouts without requiring direct editing of configuration files.

Changes made with localectl are persistent and affect all users on the system. The tool communicates with systemd-localed, a system service that handles locale configuration.

Common options

FlagWhat it does
--helpShow help message and exit
-H, --host=HOSTExecute the operation on a remote host
--no-pagerDo not pipe output into a pager
--no-ask-passwordDo not ask for sudo/authentication password

Examples

Show current locale and keyboard layout settings

localectl

List all available locales on the system

localectl list-locales

Set the system locale to English (US) with UTF-8 encoding

localectl set-locale LANG=en_US.UTF-8

Set language to German and time locale to German format

localectl set-locale LANG=de_DE.UTF-8 LC_TIME=de_DE.UTF-8

List all available keyboard layouts

localectl list-keymaps

Set console keyboard layout to US

localectl set-keymap us

Set X11 keyboard layout to German

localectl set-x11-keymap de

Set keyboard to French without converting X11 layout

localectl set-keymap --no-convert fr

Related commands