How to apply a new keyboard layout but without reboot?

Hello Friends

Through VirtualBox was installed Debian 12 as server and is need it to change the keyboard layout.

I did do a research on Google and mostly taking the following link as main reference:

Thus as root was executed the following set of commands:

  • localectl status (it to know the current “X11 Model”)
  • dpkg-reconfigure keyboard-configuration
  • systemctl restart keyboard-setup.service
  • udevadm trigger --subsystem-match=input --action=change (because the previous one didn’t reflect the change)
  • localectl status (appears the new changes but not being applied)

Thus is mandatory do a reboot

Question

  • How to apply a new keyboard layout but without reboot?

Thank You

2 Likes

If you add a language you get that option when switching. I run mint and on the graphical interface bottom right next to the clock i get the language option that changes the keyboard layout.

Hello Paul

Pls remember it is for a server environment.

Your suggested approach is used by my side too, it for 3 OS - BTW to do that switch is practically mandatory add before each “Locale” to the “Keyboard” at “Settings”

1 Like

Sorry did not see that part of the request. Rebooting a server takes more. My answer is not suitable for that

You may be able to trigger it to read all the changed config files if you log out and log in again.

If that does not work, the traditional way to make Unix reread all its config files is to stop and restart the init process.
No idea how to do that with systemd, but the old fashioned way in BSD was kill -1 1… because init starts all other daemons, when it restarts it will restart all other daemons and they will read their config files.

Maybe kill -TERM 1 or killall 1 would work better in Linux.

What you want to achieve is restart the init process, without stopping the kernel or causing it to panic.

2 Likes

It is very interesting. I want avoid the kernel panic :slight_smile:
I assumed there is a missing command not indicated in the official documentation

BTW: almost the same commands were executed in Ubuntu and the boot effect was not required. So Debian has something there …

2 Likes

Yes. It was definitely possible in BSD 20 years ago, and probably still is.
I will be interested to see if you can get Linux to kill its init process. That would be useful.

1 Like

Yes. It was definitely possible in BSD 20 years ago, and probably still is.
I will be interested to see if you can get Linux to kill its init process. Thay would be useful.

Wooh …

I wrote the same question in official Debian Forum. So I have the hope that something is need it (an extra command)

I remember a friendly member in this network with the Debian logo, perhaps he had the same situation as me and he has the solution or guidance

As usual Neville thanks for your support :beer_mug:

3 Likes

The solution is:

The extra command to be executed was setupcon. And it is indicated in the content of the man keyboard command

And after to tested twice for a server environment the final set of commands is:

  • localectl status (to know the X11 Model)
  • dpkg-reconfigure keyboard-configuration
  • setupcon

Huge thanks and credits to arzgi at: How to apply a new keyboard layout but without reboot?

2 Likes