LOCALECTL(1)
๐ LOCALECTL ๐ (that's the localectl manual, section 1, bestie)
okay so quick vibe check: you're reading the LOCALECTL(1) page. it's about locale stuff and keyboard stuff and honestly? it's giving sysadmin glow-up. let's go ๐ธ
โจ NAME โจ
localectl โ control the system locale and keyboard layout settings ๐
๐ SYNOPSIS ๐
localectl [OPTIONS...] {COMMAND}
๐ฆ DESCRIPTION ๐ฆ
so like, localectl is the girl you call when you wanna query and change the system locale and keyboard layout settings. she doesn't do it alone tho โ she talks to systemd-localed(8) to go modify files like /etc/locale.conf and /etc/vconsole.conf. teamwork makes the dream work fr fr ๐ซถ
the system locale controls the language settings of system services and of the UI before the user logs in โ think display manager โ and it's also the default for users after they log in. so basically it's the main character of your language settings, no cap ๐
the keyboard settings control the keyboard layout used on the text console and of the graphical UI before the user logs in (display manager again, iconic), and also the default for users after login. your keyboard, your rules ๐
โ ๏ธ heads up bestie โ changes you make with this tool might require the initrd to be rebuilt for them to actually take effect during early system boot. and no, localectl does not rebuild the initrd automatically. that's a manual task, usually done by reinstalling the distribution's kernel package. not me forgetting that step every single time ๐ญ
๐ also note: systemd-firstboot(1) may be used to initialize the system locale for mounted (but not booted) system images. different situation, different girlie.
๐ COMMANDS ๐
here's the lineup, these are the commands that are understood:
statusโ shows you the current settings of the system locale and keyboard mapping. and if you don't specify any command at all? this one is the implied default. she just shows up uninvited, love that for her โจ
Added in version 195.
set-locale LOCALE,set-locale VARIABLE=LOCALE...โ sets the system locale. you can hand her one locale like"en_US.UTF-8", or one or more locale assignments like"LANG=de_DE.utf8","LC_MESSAGES=en_GB.utf8", and so on. if you give just one locale with no variable name, then the"LANG="locale variable gets set. seelocale(7)for all the deets on the available settings and what they mean. and uselist-localesto see what locales you actually have (it's below, keep scrolling ๐)
Added in version 195.
list-localesโ lists the available locales that are useful for configuring withset-locale. window shopping, but for locales ๐๏ธ
Added in version 195.
set-keymap MAP [TOGGLEMAP]โ sets the system keyboard mapping for the console and X11. takes a mapping name (like"de"or"us"), and possibly a second one to define a toggle keyboard mapping. unless--no-convertis passed, the selected setting also gets applied as the default system keyboard mapping of X11, after converting it to the closest matching X11 keyboard mapping. uselist-keymapsfor a list of available keyboard mappings (below, bestie โฌ๏ธ)
Added in version 195.
list-keymapsโ lists available keyboard mappings for the console, useful for configuring withset-keymap. ๐
Added in version 195.
set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]โ sets the system default keyboard mapping for X11 and the virtual console. takes a keyboard mapping name (like"de"or"us"), and possibly a model, variant, and options โ seekbd(4)for details. unless--no-convertis passed, the selected setting also gets applied as the system console keyboard mapping, after converting it to the closest matching console keyboard mapping. she converts, she slays ๐ฅ
Added in version 195.
list-x11-keymap-models,list-x11-keymap-layouts,list-x11-keymap-variants [LAYOUT],list-x11-keymap-optionsโ lists available X11 keymap models, layouts, variants and options, useful for configuring withset-keymap. thelist-x11-keymap-variantscommand optionally takes a layout parameter to limit the output to only the variants that are suitable for that specific layout. picky, but make it fashion ๐
Added in version 201.
๐ธ OPTIONS ๐ธ
these are the options that are understood:
-l,--fullโ do not ellipsize the output. give me the WHOLE thing, no cutting off, we don't do cropped over here โ๏ธ๐ซ
Added in version 257.
--no-convertโ ifset-keymaporset-x11-keymapis invoked and this option is passed, then the keymap will not be converted from the console to X11, or from X11 to console, respectively. you're saying "no thank you, I'll take it as-is" ๐
Added in version 195.
-H,--host=โ execute the operation remotely. specify a hostname, or a username and hostname separated by"@", to connect to. the hostname may optionally be suffixed by a port ssh is listening on, separated by":", and then a container name, separated by"/", which connects directly to a specific container on the specified host. this uses SSH to talk to the remote machine manager instance. container names may be enumerated withmachinectl -H HOST. and put IPv6 addresses in brackets, okay? brackets. ๐ซถ-M,--machine=โ execute operation on a local container. specify a container name to connect to, optionally prefixed by a user name to connect as and a separating"@"character. if the special string".host"is used in place of the container name, a connection to the local system is made (which is useful to connect to a specific user's user bus:"--user --machine=lennart@.host"). if the"@"syntax is not used, the connection is made as root user. if the"@"syntax is used, either the left hand side or the right hand side may be omitted (but not both) โ in that case the local user name and".host"are implied. so many little rules but honestly? it's giving attention to detail ๐--no-ask-passwordโ do not query the user for authentication for privileged operations. no popups, no interruptions, just vibes ๐ฆ-h,--helpโ print a short help text and exit. the classic "what does this even do" move ๐ญ--versionโ print a short version string and exit. ๐--no-pagerโ do not pipe output into a pager. dump it straight to the terminal, we die like real ones ๐
๐ง EXIT STATUS ๐ง
on success, 0 is returned. a non-zero failure code otherwise. that's it, that's the whole thing. 0 = slay, anything else = we have a problem โจ
$SYSTEMD_LOG_LEVELโ the max log level of messages that get emitted, meaning anything with a higher log level (aka less important, aka the lil drama-free ones) gets straight-up suppressed. ๐ค It takes a comma-separated list of values, and each value is either one of these (listed in order of decreasing importance) โemerg,alert,crit,err,warning,notice,info,debugโ or just an integer in the range0...7. Peepsyslog(3)for the whole lore. Each value can also be prefixed with one ofconsole,syslog,kmsgorjournalfollowed by a colon, which sets the max log level for that one specific log target, likeSYSTEMD_LOG_LEVEL=debug,console:infoโ that one says "log at debug level everywhere except the console, which should be at info level." Note bestie: the global max log level takes priority over any per-target max log levels. No cap. ๐$SYSTEMD_LOG_COLORโ a boolean. If it's true, messages written to the tty get colored according to priority. ๐
Heads up tho: this setting is only useful when messages are written directly to the terminal, because journalctl(1) and other tools that display logs will color messages based on the log level on their own. They got it handled. ๐
$SYSTEMD_LOG_TIMEโ a boolean. If true, console log messages get prefixed with a timestamp. โฐ
Same deal as above: this is only useful when messages are written directly to the terminal or a file, because journalctl(1) and other tools that display logs attach timestamps based on the entry metadata on their own. They don't need ur help.
$SYSTEMD_LOG_LOCATIONโ a boolean. If true, messages get prefixed with a filename and line number in the source code where the message originates. ๐
Note that the log location is often attached as metadata to journal entries anyway โ but including it directly in the message text can nevertheless be convenient when debugging programs. Debugging era. ๐
$SYSTEMD_LOG_TIDโ a boolean. If true, messages get prefixed with the current numerical thread ID (TID). ๐งต
Note that the this information is attached as metadata to journal entries anyway โ but including it directly in the message text can nevertheless be convenient when debugging programs.
$SYSTEMD_LOG_TARGETโ where the log messages go. One ofconsole(log to the attached tty),console-prefixed(log to the attached tty but with prefixes encoding the log level and "facility", seesyslog(3)),kmsg(log to the kernel circular log buffer),journal(log to the journal),journal-or-kmsg(log to the journal if available, and tokmsgotherwise),auto(determine the appropriate log target automatically, the default), ornull(disable log output). Pick ur fighter. ๐ฅ$SYSTEMD_LOG_RATELIMIT_KMSGโ whether to ratelimitkmsgor not. Takes a boolean. Defaults to"true". If disabled, systemd will not ratelimit messages written tokmsg. ๐ฆ$SYSTEMD_PAGER,$PAGERโ which pager to use when--no-pagerisn't given.$SYSTEMD_PAGERis used if it's set; otherwise$PAGERis used. If neither$SYSTEMD_PAGERnor$PAGERare set, a set of well-known pager implementations gets tried in turn โ includingless(1)andmore(1)โ until one is found. And if no pager implementation is discovered at all? No pager is invoked, we just vibe raw. ๐ Setting those environment variables to an empty string or the value"cat"is equivalent to passing--no-pager.
Note: if$SYSTEMD_PAGERSECUREis not set,$SYSTEMD_PAGERand$PAGERcan only be used to disable the pager (with"cat"or""), and are otherwise ignored. Like, straight up ignored. ๐ซฅ
$SYSTEMD_LESSโ override the options passed toless(by default"FRSXMK"). ๐
Users might want to change two options in particular:
K
This option instructs the pager to exit immediately when Ctrl+C is pressed. To allow less to handle Ctrl+C itself and switch back to the pager command prompt, unset this option.
If the value of $SYSTEMD_LESS does not include "K", and the pager that is invoked is less, Ctrl+C will be ignored by the executable, and needs to be handled by the pager.
X
This option instructs the pager to not send termcap initialization and deinitialization strings to the terminal. It's set by default to allow command output to remain visible in the terminal even after the pager exits. Nevertheless, this prevents some pager functionality from working โ in particular, paged output cannot be scrolled with the mouse. ๐ฑ๏ธ๐ญ
Note that setting the regular $LESS environment variable has no effect for less invocations by systemd tools. Not the one, bestie.
See less(1) for more discussion.
$SYSTEMD_LESSCHARSETโ override the charset passed toless(by default"utf-8", if the invoking terminal is determined to be UTF-8 compatible). ๐ค
Note that setting the regular $LESSCHARSET environment variable has no effect for less invocations by systemd tools.
$SYSTEMD_PAGERSECUREโ okay this one is the serious one, so listen up. ๐จ Common pager commands likeless(1), in addition to "paging" (aka scrolling through the output), support opening of or writing to other files and running arbitrary shell commands. When commands are invoked with elevated privileges โ for example undersudo(8)orpkexec(1)โ the pager becomes a security boundary. Care must be taken that only programs with strictly limited functionality are used as pagers, and that unintended interactive features like opening or creation of new files or starting of subprocesses are not allowed. "Secure mode" for the pager may be enabled as described below, if the pager supports that (most pagers are not written in a way that takes this into consideration, which is giving ๐ฉ). It is recommended to either explicitly enable "secure mode" or to completely disable the pager using--no-pagerorPAGER=catwhen allowing untrusted users to execute commands with elevated privileges.
This option takes a boolean argument. When set to true, the "secure mode" of the pager is enabled. In "secure mode", LESSSECURE=1 will be set when invoking the pager, which instructs the pager to disable commands that open or create new files or start new subprocesses. Currently only less(1) is known to understand this variable and implement "secure mode".
When set to false, no limitation is placed on the pager. Setting SYSTEMD_PAGERSECURE=0 or not removing it from the inherited environment may allow the user to invoke arbitrary commands. ๐ฌ
When $SYSTEMD_PAGERSECURE is not set, systemd tools attempt to automatically figure out if "secure mode" should be enabled and whether the pager supports it. "Secure mode" is enabled if the effective UID is not the same as the owner of the login session, see geteuid(2) and sd_pid_get_owner_uid(3), or when running under sudo(8) or similar tools ($SUDO_UID is set [1]). In those cases, SYSTEMD_PAGERSECURE=1 will be set and pagers which are not known to implement "secure mode" will not be used at all. Note that this autodetection only covers the most common mechanisms to elevate privileges and is intended as convenience. It is recommended to explicitly set $SYSTEMD_PAGERSECURE or disable the pager.
Note that if the $SYSTEMD_PAGER or $PAGER variables are to be honoured, other than to disable the pager, $SYSTEMD_PAGERSECURE must be set too. Package deal, fr fr. ๐ค
$SYSTEMD_COLORSโ takes a boolean argument, or a special value. By default (unset), systemd and related utilities will use colors in their output if possible. If$COLORTERMis set to"truecolor"or"24bit", 24-bit colors will be enabled, 256 colors otherwise โ unless$NO_COLORor$TERMindicates colors are disabled. ๐จtrueโ same as unset, except that$NO_COLORis ignored.falseโ the output will be monochrome. ๐ค"16","256","24bit"โ always use the base 16 ANSI colors, 256 colors, or 24 bit color, respectively."auto-16","auto-256","auto-24bit"โ use the given quantity of colours, subject to$TERM, and what the console is connected to.
$SYSTEMD_URLIFYโ the value must be a boolean. Controls whether clickable links should be generated in the output for terminal emulators supporting this. This can be specified to override the decision that systemd makes based on$TERMand other conditions. ๐โจ
๐ซถ SEE ALSO ๐ซถ
systemd(1), locale(7), locale.conf(5), vconsole.conf(5), loadkeys(1), kbd(4), The XKB Configuration Guide[2], systemctl(1), systemd-localed.service(8), systemd-firstboot(1)
๐ NOTES ๐
- It is recommended for other tools to set and check
$SUDO_UIDas appropriate, treating it is a common interface. - The XKB Configuration Guide
http://www.x.org/releases/current/doc/xorg-docs/input/XKB-Config.html
And that's the whole page bestie, u made it to the end!! ๐ This one's from systemd 262.1, and the page itself is LOCALECTL(1). Go forth and locale-configurate, icon. ๐๐ฆ๐
๐ฆ where this page comes from
- arch rolling: systemd 262.1-1 ยท LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later AND MIT-0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms