2

I have an Ubuntu Server 18.04 with more than 500 users (not simultaneous), and I can't set a global keyboard setting to all users for the GUI (running the default GNOME installation).

The physical machine has a Brazilian ABNT2 keyboard layout that appears to be configured correctly:

root@gilneas:/# cat /etc/default/keyboard 
# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="br"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"

root@gilneas:/# grep -v \# /etc/locale.gen 
en_US.UTF-8 UTF-8
pt_BR.UTF-8 UTF-8

I tried running dpkg-reconfigure keyboard-configuration and regenerated the locates with locale-gen --purge. But nothing works, as GNOME does not honor the configurations and selects English (US) as the default keyboard.

This settings used to work on previous Ubuntu Server LTS versions: 12.04, 14.04 and 16.04; are all working accordingly. But not on 18.04.

Maurício Mota
  • 199
  • 2
  • 9
Vinícius Ferrão
  • 5,400
  • 10
  • 52
  • 91

1 Answers1

1

Figured out. The problem is by default IBUS ignores the system settings and overrides it. So we need to configure IBUS to honor the system keyboard settings. To do this, just create the file /etc/dconf/db/ibus.d/01-fixkeyboard with the following contents:

[desktop/ibus/general]
use-system-keyboard-layout=true

After it issue dconf update and it should be good.

Keep in mind that this solves the issues for accounts that haven't overridden the keyboard setting on the GNOME settings. In my case I wiped all the GNOME user settings with the help this question: https://askubuntu.com/questions/56313/how-do-i-reset-gnome-to-the-defaults#56314

Vinícius Ferrão
  • 5,400
  • 10
  • 52
  • 91