1 <?xml version='
1.0'
?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id=
"localectl" conditional='ENABLE_LOCALED'
7 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
10 <title>localectl
</title>
11 <productname>systemd
</productname>
15 <refentrytitle>localectl
</refentrytitle>
16 <manvolnum>1</manvolnum>
20 <refname>localectl
</refname>
21 <refpurpose>Control the system locale and keyboard layout settings
</refpurpose>
26 <command>localectl
</command>
27 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
28 <arg choice=
"req">COMMAND
</arg>
33 <title>Description
</title>
35 <para><command>localectl
</command> may be used to query and change
36 the system locale and keyboard layout settings. It communicates with
37 <citerefentry><refentrytitle>systemd-localed
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
38 to modify files such as
<filename>/etc/locale.conf
</filename> and
39 <filename>/etc/vconsole.conf
</filename>.
</para>
41 <para>The system locale controls the language settings of system
42 services and of the UI before the user logs in, such as the
43 display manager, as well as the default for users after
46 <para>The keyboard settings control the keyboard layout used on
47 the text console and of the graphical UI before the user logs in,
48 such as the display manager, as well as the default for users
51 <para>Note that the changes performed using this tool might require the initrd to be rebuilt to take
52 effect during early system boot. The initrd is not rebuilt automatically by
53 <filename>localectl
</filename>, this task has to be performed manually, usually using a tool like
55 project='man-pages'
><refentrytitle>dracut
</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
59 <citerefentry><refentrytitle>systemd-firstboot
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
60 may be used to initialize the system locale for mounted (but not booted)
65 <title>Commands
</title>
67 <para>The following commands are understood:
</para>
71 <term><command>status
</command></term>
73 <listitem><para>Show current settings of the system locale and keyboard mapping.
74 If no command is specified, this is the implied default.
</para>
76 <xi:include href=
"version-info.xml" xpointer=
"v195"/></listitem>
80 <term><command>set-locale LOCALE
</command></term>
81 <term><command>set-locale VARIABLE=LOCALEā¦
</command></term>
83 <listitem><para>Set the system locale. This takes one locale such as
<literal>en_US.UTF-
8</literal>, or takes one or more
84 locale assignments such as
<literal>LANG=de_DE.utf8
</literal>,
<literal>LC_MESSAGES=en_GB.utf8
</literal>, and so on. If
85 one locale without variable name is provided, then
<literal>LANG=
</literal> locale variable will be set. See
86 <citerefentry project='man-pages'
><refentrytitle>locale
</refentrytitle><manvolnum>7</manvolnum></citerefentry>
87 for details on the available settings and their meanings. Use
88 <command>list-locales
</command> for a list of available
89 locales (see below).
</para>
91 <xi:include href=
"version-info.xml" xpointer=
"v195"/></listitem>
95 <term><command>list-locales
</command></term>
97 <listitem><para>List available locales useful for
99 <command>set-locale
</command>.
</para>
101 <xi:include href=
"version-info.xml" xpointer=
"v195"/></listitem>
105 <term><command>set-keymap MAP [TOGGLEMAP]
</command></term>
107 <listitem><para>Set the system keyboard mapping for the
108 console and X11. This takes a mapping name (such as
"de" or
109 "us"), and possibly a second one to define a toggle keyboard
110 mapping. Unless
<option>--no-convert
</option> is passed, the
111 selected setting is also applied as the default system
112 keyboard mapping of X11, after converting it to the closest
113 matching X11 keyboard mapping. Use
114 <command>list-keymaps
</command> for a list of available
115 keyboard mappings (see below).
</para>
117 <xi:include href=
"version-info.xml" xpointer=
"v195"/></listitem>
121 <term><command>list-keymaps
</command></term>
123 <listitem><para>List available keyboard mappings for the
124 console, useful for configuration with
125 <command>set-keymap
</command>.
</para>
127 <xi:include href=
"version-info.xml" xpointer=
"v195"/></listitem>
131 <term><command>set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]
</command></term>
133 <listitem><para>Set the system default keyboard mapping for
134 X11 and the virtual console. This takes a keyboard mapping
135 name (such as
<literal>de
</literal> or
<literal>us
</literal>),
136 and possibly a model, variant, and options, see
137 <citerefentry><refentrytitle>kbd
</refentrytitle><manvolnum>4</manvolnum></citerefentry>
138 for details. Unless
<option>--no-convert
</option> is passed,
139 the selected setting is also applied as the system console
140 keyboard mapping, after converting it to the closest matching
141 console keyboard mapping.
</para>
143 <xi:include href=
"version-info.xml" xpointer=
"v195"/></listitem>
147 <term><command>list-x11-keymap-models
</command></term>
148 <term><command>list-x11-keymap-layouts
</command></term>
149 <term><command>list-x11-keymap-variants [LAYOUT]
</command></term>
150 <term><command>list-x11-keymap-options
</command></term>
152 <listitem><para>List available X11 keymap models, layouts,
153 variants and options, useful for configuration with
154 <command>set-keymap
</command>. The command
155 <command>list-x11-keymap-variants
</command> optionally takes a
156 layout parameter to limit the output to the variants suitable
157 for the specific layout.
</para>
159 <xi:include href=
"version-info.xml" xpointer=
"v201"/></listitem>
166 <title>Options
</title>
168 <para>The following options are understood:
</para>
172 <term><option>--no-ask-password
</option></term>
174 <listitem><para>Do not query the user for authentication for
175 privileged operations.
</para>
177 <xi:include href=
"version-info.xml" xpointer=
"v195"/></listitem>
181 <term><option>--no-convert
</option></term>
183 <listitem><para>If
<command>set-keymap
</command> or
184 <command>set-x11-keymap
</command> is invoked and this option
185 is passed, then the keymap will not be converted from the
186 console to X11, or X11 to console,
189 <xi:include href=
"version-info.xml" xpointer=
"v195"/></listitem>
192 <xi:include href=
"user-system-options.xml" xpointer=
"host" />
193 <xi:include href=
"user-system-options.xml" xpointer=
"machine" />
195 <xi:include href=
"standard-options.xml" xpointer=
"help" />
196 <xi:include href=
"standard-options.xml" xpointer=
"version" />
197 <xi:include href=
"standard-options.xml" xpointer=
"no-pager" />
202 <title>Exit status
</title>
204 <para>On success,
0 is returned, a non-zero failure code
208 <xi:include href=
"common-variables.xml" />
211 <title>See Also
</title>
213 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
214 <citerefentry project='man-pages'
><refentrytitle>locale
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
215 <citerefentry project='man-pages'
><refentrytitle>locale.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
216 <citerefentry><refentrytitle>vconsole.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
217 <citerefentry project='mankier'
><refentrytitle>loadkeys
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
218 <citerefentry><refentrytitle>kbd
</refentrytitle><manvolnum>4</manvolnum></citerefentry>,
219 <ulink url=
"http://www.x.org/releases/current/doc/xorg-docs/input/XKB-Config.html">
220 The XKB Configuration Guide
222 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
223 <citerefentry><refentrytitle>systemd-localed.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
224 <citerefentry><refentrytitle>systemd-firstboot
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
225 <citerefentry project='man-pages'
><refentrytitle>dracut
</refentrytitle><manvolnum>8</manvolnum></citerefentry>