1LOCALECTL(1)                       localectl                      LOCALECTL(1)
2
3
4

NAME

6       localectl - Control the system locale and keyboard layout settings
7

SYNOPSIS

9       localectl [OPTIONS...] {COMMAND}
10

DESCRIPTION

12       localectl may be used to query and change the system locale and
13       keyboard layout settings. It communicates with systemd-localed(8) to
14       modify files such as /etc/locale.conf and /etc/vconsole.conf.
15
16       The system locale controls the language settings of system services and
17       of the UI before the user logs in, such as the display manager, as well
18       as the default for users after login.
19
20       The keyboard settings control the keyboard layout used on the text
21       console and of the graphical UI before the user logs in, such as the
22       display manager, as well as the default for users after login.
23
24       Note that the changes performed using this tool might require the
25       initrd to be rebuilt to take effect during early system boot. The
26       initrd is not rebuilt automatically by localectl, this task has to be
27       performed manually, usually using a tool like dracut(8).
28
29       Note that systemd-firstboot(1) may be used to initialize the system
30       locale for mounted (but not booted) system images.
31

COMMANDS

33       The following commands are understood:
34
35       status
36           Show current settings of the system locale and keyboard mapping. If
37           no command is specified, this is the implied default.
38
39       set-locale LOCALE, set-locale VARIABLE=LOCALE...
40           Set the system locale. This takes one locale such as "en_US.UTF-8",
41           or takes one or more locale assignments such as "LANG=de_DE.utf8",
42           "LC_MESSAGES=en_GB.utf8", and so on. If one locale without variable
43           name is provided, then "LANG=" locale variable will be set. See
44           locale(7) for details on the available settings and their meanings.
45           Use list-locales for a list of available locales (see below).
46
47       list-locales
48           List available locales useful for configuration with set-locale.
49
50       set-keymap MAP [TOGGLEMAP]
51           Set the system keyboard mapping for the console and X11. This takes
52           a mapping name (such as "de" or "us"), and possibly a second one to
53           define a toggle keyboard mapping. Unless --no-convert is passed,
54           the selected setting is also applied as the default system keyboard
55           mapping of X11, after converting it to the closest matching X11
56           keyboard mapping. Use list-keymaps for a list of available keyboard
57           mappings (see below).
58
59       list-keymaps
60           List available keyboard mappings for the console, useful for
61           configuration with set-keymap.
62
63       set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]
64           Set the system default keyboard mapping for X11 and the virtual
65           console. This takes a keyboard mapping name (such as "de" or "us"),
66           and possibly a model, variant, and options, see kbd(4) for details.
67           Unless --no-convert is passed, the selected setting is also applied
68           as the system console keyboard mapping, after converting it to the
69           closest matching console keyboard mapping.
70
71       list-x11-keymap-models, list-x11-keymap-layouts,
72       list-x11-keymap-variants [LAYOUT], list-x11-keymap-options
73           List available X11 keymap models, layouts, variants and options,
74           useful for configuration with set-keymap. The command
75           list-x11-keymap-variants optionally takes a layout parameter to
76           limit the output to the variants suitable for the specific layout.
77

OPTIONS

79       The following options are understood:
80
81       --no-ask-password
82           Do not query the user for authentication for privileged operations.
83
84       --no-convert
85           If set-keymap or set-x11-keymap is invoked and this option is
86           passed, then the keymap will not be converted from the console to
87           X11, or X11 to console, respectively.
88
89       -H, --host=
90           Execute the operation remotely. Specify a hostname, or a username
91           and hostname separated by "@", to connect to. The hostname may
92           optionally be suffixed by a port ssh is listening on, separated by
93           ":", and then a container name, separated by "/", which connects
94           directly to a specific container on the specified host. This will
95           use SSH to talk to the remote machine manager instance. Container
96           names may be enumerated with machinectl -H HOST. Put IPv6 addresses
97           in brackets.
98
99       -M, --machine=
100           Execute operation on a local container. Specify a container name to
101           connect to, optionally prefixed by a user name to connect as and a
102           separating "@" character. If the special string ".host" is used in
103           place of the container name, a connection to the local system is
104           made (which is useful to connect to a specific user's user bus:
105           "--user --machine=lennart@.host"). If the "@" syntax is not used,
106           the connection is made as root user. If the "@" syntax is used
107           either the left hand side or the right hand side may be omitted
108           (but not both) in which case the local user name and ".host" are
109           implied.
110
111       -h, --help
112           Print a short help text and exit.
113
114       --version
115           Print a short version string and exit.
116
117       --no-pager
118           Do not pipe output into a pager.
119

EXIT STATUS

121       On success, 0 is returned, a non-zero failure code otherwise.
122

ENVIRONMENT

124       $SYSTEMD_LOG_LEVEL
125           The maximum log level of emitted messages (messages with a higher
126           log level, i.e. less important ones, will be suppressed). Either
127           one of (in order of decreasing importance) emerg, alert, crit, err,
128           warning, notice, info, debug, or an integer in the range 0...7. See
129           syslog(3) for more information.
130
131       $SYSTEMD_LOG_COLOR
132           A boolean. If true, messages written to the tty will be colored
133           according to priority.
134
135           This setting is only useful when messages are written directly to
136           the terminal, because journalctl(1) and other tools that display
137           logs will color messages based on the log level on their own.
138
139       $SYSTEMD_LOG_TIME
140           A boolean. If true, console log messages will be prefixed with a
141           timestamp.
142
143           This setting is only useful when messages are written directly to
144           the terminal or a file, because journalctl(1) and other tools that
145           display logs will attach timestamps based on the entry metadata on
146           their own.
147
148       $SYSTEMD_LOG_LOCATION
149           A boolean. If true, messages will be prefixed with a filename and
150           line number in the source code where the message originates.
151
152           Note that the log location is often attached as metadata to journal
153           entries anyway. Including it directly in the message text can
154           nevertheless be convenient when debugging programs.
155
156       $SYSTEMD_LOG_TID
157           A boolean. If true, messages will be prefixed with the current
158           numerical thread ID (TID).
159
160           Note that the this information is attached as metadata to journal
161           entries anyway. Including it directly in the message text can
162           nevertheless be convenient when debugging programs.
163
164       $SYSTEMD_LOG_TARGET
165           The destination for log messages. One of console (log to the
166           attached tty), console-prefixed (log to the attached tty but with
167           prefixes encoding the log level and "facility", see syslog(3), kmsg
168           (log to the kernel circular log buffer), journal (log to the
169           journal), journal-or-kmsg (log to the journal if available, and to
170           kmsg otherwise), auto (determine the appropriate log target
171           automatically, the default), null (disable log output).
172
173       $SYSTEMD_PAGER
174           Pager to use when --no-pager is not given; overrides $PAGER. If
175           neither $SYSTEMD_PAGER nor $PAGER are set, a set of well-known
176           pager implementations are tried in turn, including less(1) and
177           more(1), until one is found. If no pager implementation is
178           discovered no pager is invoked. Setting this environment variable
179           to an empty string or the value "cat" is equivalent to passing
180           --no-pager.
181
182           Note: if $SYSTEMD_PAGERSECURE is not set, $SYSTEMD_PAGER (as well
183           as $PAGER) will be silently ignored.
184
185       $SYSTEMD_LESS
186           Override the options passed to less (by default "FRSXMK").
187
188           Users might want to change two options in particular:
189
190           K
191               This option instructs the pager to exit immediately when Ctrl+C
192               is pressed. To allow less to handle Ctrl+C itself to switch
193               back to the pager command prompt, unset this option.
194
195               If the value of $SYSTEMD_LESS does not include "K", and the
196               pager that is invoked is less, Ctrl+C will be ignored by the
197               executable, and needs to be handled by the pager.
198
199           X
200               This option instructs the pager to not send termcap
201               initialization and deinitialization strings to the terminal. It
202               is set by default to allow command output to remain visible in
203               the terminal even after the pager exits. Nevertheless, this
204               prevents some pager functionality from working, in particular
205               paged output cannot be scrolled with the mouse.
206
207           See less(1) for more discussion.
208
209       $SYSTEMD_LESSCHARSET
210           Override the charset passed to less (by default "utf-8", if the
211           invoking terminal is determined to be UTF-8 compatible).
212
213       $SYSTEMD_PAGERSECURE
214           Takes a boolean argument. When true, the "secure" mode of the pager
215           is enabled; if false, disabled. If $SYSTEMD_PAGERSECURE is not set
216           at all, secure mode is enabled if the effective UID is not the same
217           as the owner of the login session, see geteuid(2) and
218           sd_pid_get_owner_uid(3). In secure mode, LESSSECURE=1 will be set
219           when invoking the pager, and the pager shall disable commands that
220           open or create new files or start new subprocesses. When
221           $SYSTEMD_PAGERSECURE is not set at all, pagers which are not known
222           to implement secure mode will not be used. (Currently only less(1)
223           implements secure mode.)
224
225           Note: when commands are invoked with elevated privileges, for
226           example under sudo(8) or pkexec(1), care must be taken to ensure
227           that unintended interactive features are not enabled. "Secure" mode
228           for the pager may be enabled automatically as describe above.
229           Setting SYSTEMD_PAGERSECURE=0 or not removing it from the inherited
230           environment allows the user to invoke arbitrary commands. Note that
231           if the $SYSTEMD_PAGER or $PAGER variables are to be honoured,
232           $SYSTEMD_PAGERSECURE must be set too. It might be reasonable to
233           completely disable the pager using --no-pager instead.
234
235       $SYSTEMD_COLORS
236           Takes a boolean argument. When true, systemd and related utilities
237           will use colors in their output, otherwise the output will be
238           monochrome. Additionally, the variable can take one of the
239           following special values: "16", "256" to restrict the use of colors
240           to the base 16 or 256 ANSI colors, respectively. This can be
241           specified to override the automatic decision based on $TERM and
242           what the console is connected to.
243
244       $SYSTEMD_URLIFY
245           The value must be a boolean. Controls whether clickable links
246           should be generated in the output for terminal emulators supporting
247           this. This can be specified to override the decision that systemd
248           makes based on $TERM and other conditions.
249

SEE ALSO

251       systemd(1), locale(7), locale.conf(5), vconsole.conf(5), loadkeys(1),
252       kbd(4), The XKB Configuration Guide[1], systemctl(1), systemd-
253       localed.service(8), systemd-firstboot(1), dracut(8)
254

NOTES

256        1. The XKB Configuration Guide
257           http://www.x.org/releases/current/doc/xorg-docs/input/XKB-Config.html
258
259
260
261systemd 253                                                       LOCALECTL(1)
Impressum