Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

5 votes
3 answers
4286 views
Add second keyboard layout with localectl
I am using Fedora 28 workstation with Gnome. My current layout status with `localectl status` is System Locale: LANG=en_US.UTF-8 VC Keymap: us X11 Layout: us I am using localectl set-x11-keymap "us,gr" "" "," in order to add second (greek) layout. New `localectl status` result is System Locale: LANG...
I am using Fedora 28 workstation with Gnome. My current layout status with localectl status is System Locale: LANG=en_US.UTF-8 VC Keymap: us X11 Layout: us I am using localectl set-x11-keymap "us,gr" "" "," in order to add second (greek) layout. New localectl status result is System Locale: LANG=en_US.UTF-8 VC Keymap: us X11 Layout: us,gr X11 Variant: , but when I press super(key) + space, no greek characters are displayed. How can I add a second keyboard layout with command line? I have a fresh install of Fedora 28 Workstation. Selected language and keyboard layout are "US". I am trying to add a second language in the keyboard but not from Gnome (i.e. Settings->Region & Language-> Input Source), but from the command line. I am using localectl; when I use set-keymap, I can write greek characters on the login screen but not in a terminal. I am trying set-x11-keymap and I can't write greek characters -- only US. When I enter the simple command localectl set-x11-keymap us,gr in the login screen the language selector is present. But AFTER I log in, there is no language selector in the taskbar!?!?! I then made a clean install. Step 1: before I make anything, I execute setxkbmap -print and I get xkb_keymap { xkb_keycodes { include "evdev+aliases(qwerty)" }; xkb_types { include "complete" }; xkb_compat { include "complete" }; xkb_symbols { include "pc+us+inet(evdev)" }; xkb_geometry { include "pc(pc105)" }; }; Step 2: I execute the following command setxkbmap -layout "us,gr" -option "grp:win_space_toggle" Step 3: now I am trying to press win+space keys but I can't print greek characters. Step 4: the output of setxkbmap -print is now xkb_keymap { xkb_keycodes { include "evdev+aliases(qwerty)" }; xkb_types { include "complete" }; xkb_compat { include "complete" }; xkb_symbols { include "pc+us+gr:2+inet(evdev)+group(win_space_toggle)"}; xkb_geometry { include "pc(pc105)" }; }; I logged out and there is no language selector on login screen. Also: after I log in, I can write only English characters.
chris (51 rep)
Aug 15, 2020, 09:21 AM • Last activity: Jul 28, 2025, 08:02 PM
0 votes
1 answers
241 views
setting system locale to C...what is the appropriate charmap?
i use arch and want to set my whole system's locale to `C` (and only `C`). `C` isn't listed inside `/etc/locale.gen` (and only `en_US.UTF-8 UTF-8` is uncommented) but `C` is found inside `/usr/share/i18n/locales/`. i ran command `localectl set-locale C` and logged out/in, and command `locale` shows...
i use arch and want to set my whole system's locale to C (and only C). C isn't listed inside /etc/locale.gen (and only en_US.UTF-8 UTF-8 is uncommented) but C is found inside /usr/share/i18n/locales/. i ran command localectl set-locale C and logged out/in, and command locale shows C for everything -- good. my questions are: * do i need to comment out line en_US.UTF-8 UTF-8 inside file locale.gen and run command locale-gen to remove the other undesired locale remnants from my system? * before running command locale-gen should i append C to file locale.gen, and if so, what `` is standard for it? i look inside directory /usr/share/i18n/charmaps/ but do not see anything like C.gz inside. is UTF-8.gz correct or ANSI_X3.110-1983.gz or an ISO-*/ISO_* one? i run command localectl list-locales and see: C.UTF-8 en_US.UTF-8 does this mean my locale is not entirely and only C and i have unwanted remnants of others?
leetbacoon (383 rep)
Mar 10, 2025, 06:04 AM • Last activity: Mar 10, 2025, 08:23 AM
2 votes
1 answers
247 views
How to unset a locale variable using localectl?
Under Fedora, I've set a custom locale variable value: ``` localectl set-locale LC_TIME=en_DK.UTF-8 ``` This modified LC_TIME indeed. Now I'd like to get it back to unset/empty/default state. How do I do that? Preferably, with the same tool that did the change. Both `LC_TIME=` and `LC_TIME=""` throw...
Under Fedora, I've set a custom locale variable value:
localectl set-locale LC_TIME=en_DK.UTF-8
This modified LC_TIME indeed. Now I'd like to get it back to unset/empty/default state. How do I do that? Preferably, with the same tool that did the change. Both LC_TIME= and LC_TIME="" throw an error.
Anton K (351 rep)
Jun 5, 2024, 10:09 PM • Last activity: Jun 6, 2024, 10:59 AM
1 votes
1 answers
810 views
What is the equivalent of `localectl set-keymap` command on Debian?
I am porting a shell script written for Arch to Debian. The relevant part: ``` keymaps=$(localectl list-keymaps) if test -n "${1}" && localectl list-keymaps | grep -q "${1}" then keymap="${1}" else exec 3>&1 keymap=$(/sbin/dialog --title "Keyboard layout" --menu "Choose a keyboard layout" 25 50 20 $...
I am porting a shell script written for Arch to Debian. The relevant part:
keymaps=$(localectl list-keymaps)

if test -n "${1}" && localectl list-keymaps | grep -q "${1}"
then
    keymap="${1}"
else
    exec 3>&1
    keymap=$(/sbin/dialog --title "Keyboard layout" --menu "Choose a keyboard layout" 25 50 20 $(for item in ${keymaps[@]}; do echo ${item} "-" ; done) 2>&1 1>&3) || exit 1
    exec 3>&-
fi

localectl set-keymap ${keymap}

if [[ $DISPLAY ]] && [[ -r /etc/X11/xorg.conf.d/00-keyboard.conf ]]; then
    # X11 is already running
    x11keymap=$(awk '/^\s*Option "XkbLayout"/ { print $3 }' /etc/X11/xorg.conf.d/00-keyboard.conf)
    setxkbmap -layout ${x11keymap}
fi
The problem is, localectl list-keymaps and localectl set-keymap ${keymap} do not seem to work on Debian systems. I did some research and figured out that that is because instead of using a pure systemd solution to control the keyboard layout in the console like Fedora and Arch, Debian uses a mix of systemd and sysvinit solutions. However, I was unable to find a way to set a keymap like with localectl set-keymap ${keymap}—running this command doesn't throw an error, but the layout doesn't change. I was able to make localectl list-keymaps list keymaps by manually adding them following this solution https://unix.stackexchange.com/a/763320/610025 , but I'm afraid it will not work with the actual layout changing command. Is there a Debian-working solution?
carbon-starlight (15 rep)
May 8, 2024, 01:19 AM • Last activity: May 9, 2024, 12:25 PM
3 votes
1 answers
2474 views
systemd : changing locale without rebooting
On a Debian Stretch system, when reconfiguring locales (`dpkg-reconfigure locales` as well as using `localectl`) systemd keeps running with the boot setting. Therefore services launched with `systemctl` keep on using the old (boot time) locale. I tried `systemctl daemon-reload` and `daemon-reexec` a...
On a Debian Stretch system, when reconfiguring locales (dpkg-reconfigure locales as well as using localectl) systemd keeps running with the boot setting. Therefore services launched with systemctl keep on using the old (boot time) locale. I tried systemctl daemon-reload and daemon-reexec as well. Nothing does. Is there any alternative to either rebooting or modifying the unit files?
wazoox (1374 rep)
Apr 3, 2019, 11:47 AM • Last activity: Feb 17, 2024, 08:42 AM
5 votes
2 answers
7530 views
localectl: Failed to read list of keymaps: No such file or directory
When I run localectl list-keymaps I get > Failed to read list of keymaps: No such file or directory How can I fix this error (not I have the `console-data` package installed)? It also happens when I run as root or with `sudo`?
When I run localectl list-keymaps I get > Failed to read list of keymaps: No such file or directory How can I fix this error (not I have the console-data package installed)? It also happens when I run as root or with sudo?
Evan Carroll (34663 rep)
Sep 19, 2021, 11:02 PM • Last activity: Dec 7, 2023, 06:53 PM
1 votes
1 answers
1167 views
Locale settings for RHEL 7/8
In RHEL7/8 I know we control the locale setting using localctl command and which updates the /**etc/locale.conf** file. Ex : > # localectl set-locale LANG=ja_JP.utf8 > # localectl set-keymap jp106 > # localectl System Locale: LANG=ja_JP.utf8 > VC Keymap: jp106 > X11 Layout: jp But in RHEL6 we have a...
In RHEL7/8 I know we control the locale setting using localctl command and which updates the /**etc/locale.conf** file. Ex : > # localectl set-locale LANG=ja_JP.utf8 > # localectl set-keymap jp106 > # localectl System Locale: LANG=ja_JP.utf8 > VC Keymap: jp106 > X11 Layout: jp But in RHEL6 we have another file for this purpose **/etc/sysconfig/i18n** LANG=en_US.UTF-8 SUPPORTED="en_US.UTF8:en_US:en:ja_JP.eucXXXXX" SYSFONT="lat0-sun16" SYSFONTACM="8859-15" My question is do we need these variables also in RHEL7/8. - SUPPORTED - SYSFONT - SYSFONTACM My guess is we dont need to explicitly declare these variables anymore in RHEL7/8 ?
user984993 (9 rep)
Dec 13, 2022, 12:53 AM • Last activity: Dec 13, 2022, 06:08 AM
0 votes
1 answers
450 views
TTY pre-login in QWERTY instead of AZERTY
I am french and usually types with `AZERTY` layout. My `TTYs` virtual consoles ( Ctrl + Alt + fN ) are in `QWERTY` before and after login. It's painful, because I have to log each time in `QWERTY`. Once logged in I can run `loadkeys en` (in reality I type **lo**q**dkeys en**) and it works, I am then...
I am french and usually types with AZERTY layout. My TTYs virtual consoles (Ctrl+Alt+fN) are in QWERTY before and after login. It's painful, because I have to log each time in QWERTY. Once logged in I can run loadkeys en (in reality I type **lo**q**dkeys en**) and it works, I am then in AZERTY until the next reboot. This is very annoying ! In other hand on my graphical session under X (XFCE4 as DE) I am in AZERTY. My distro is a Debian Buster. What I tested : user@host:~$ localectl list-keymaps Failed to read list of keymaps: Aucun fichier ou dossier de ce type but apparently this is a false positive user@host:~$ localectl System Locale: LANG=fr_FR.UTF-8 VC Keymap: fr X11 Layout: fr X11 Model: pc105 X11 Variant: oss_latin9 all seems OK. root@host:~# grep -r loadkeys /etc no launches in /etc A fresh install of Debian Buster runs correctly in pre-login I type in AZERTY. I'm running out of ideas ...
Le Nain Jaune (167 rep)
Oct 19, 2021, 12:50 PM • Last activity: Oct 19, 2021, 04:58 PM
7 votes
3 answers
37728 views
How can I install new locales for Debian?
When I run `localectl show-locales` on Debian, I see $ localectl list-locales C.UTF-8 en_US.UTF-8 Why is this list so abbreviated?
When I run localectl show-locales on Debian, I see $ localectl list-locales C.UTF-8 en_US.UTF-8 Why is this list so abbreviated?
Evan Carroll (34663 rep)
Sep 19, 2021, 10:56 PM • Last activity: Sep 20, 2021, 09:27 AM
Showing page 1 of 9 total questions