Up to Debian 8, I could configure the keyboard this way:

setxkbmap -model pc105 -layout us -variant alt-intl

How do I achieve the same effect in Debian Stretch? What has changed?

I do remember that, at some Debian version, I had to do that command after every X start, but it was still OK for me.

Since I installed Debian Stretch, that command will no longer take any effect. Yes, it does think it is working:

setxkbmap -query rules: evdev model: pc105 layout: us variant: alt-intl options: terminate:ctrl_alt_bksp

But it isn´t.

I managed to get it working eventually with: ibus-setup #interactive sudo ibus-daemon --xim &

But, apart from being interactive, that thing is random. Sometimes the keyboard is just going back to the crazy default layout it thinks it should apply (once even in the middle of a job coding interview!). I use English language:

echo $LANG en_US.UTF-8 I selected Netherlands timezone and an international layout with deadkeys; that´s all. I never tried to set anything related to locales that aren´t the standard US-ish-ENG-ish things.

I hope the reason it was changed it is being very useful for many people, because, It´s difficult to understand why configuring such a basic thing just the way it has worked for decades had to become so complicated nowadays.

Things I already tried and had no effect, even after restarting:

1) sudo dpkg-reconfigure keyboard-configuration

2) setupcon

3) sudo setupcon

4) udevadm trigger --subsystem-match=input --action=change

5) sudo apt-get install -y console-data console-setup console-locales keyboard-configuration

6) sudo apt-get remove ibus -y followed by an X restart.

7) rm /var/lib/xkb/*.xkm rm: cannot remove '/var/lib/xkb/*.xkm': No such file or directory

8) setxkbmap -rules evdev -model evdev -layout us -variant alt-intl

Nothing of that made the configurations made by first setxkbmap to take effect again and kept the same weird default.

Things I already tried and returned the keyboard to vanilla us (without accents/deadkeys):

1) setxkbmap -rules evdev -model evdev -layout us -variant altgr-intl

2) setxkbmap -rules evdev -model pc105 -layout us -variant altgr-intl

3) setxkbmap -rules evdev -model evdev -layout us -variant altgr-intl -option eys # no complain of bad options

4) setxkbmap -rules evdev -model pc105 -layout us -variant altgr-intl -option #clears option

5) setxkbmap -rules evdev -model pc105 -layout us -variant intl -option

6) setxkbmap -rules evdev -model pc105 -layout us -variant altgr-intl -option terminate:ctrl_alt_bksp #control-alt-backspace option

  • 1
    What happens if you place the setxkbmapdpkg command in ~/.xsessionrc ? – harrymc Oct 6 '18 at 15:28
  • Which exact distro & DE are you using? – Xen2050 Oct 11 '18 at 20:52
  • Update: After 10 months "You've earned the "Popular Question" badge (Question with 1,000 views) for "Debian Stretch 9: What changed to keyboard configuration (in X)?"." , spent all my reputations on unsuccessful bounties. Those are for me clear signs that there is no solution. – ribamar Dec 20 '18 at 13:21

I was arount 3 hours dealing with this, on a Debian 9 with xfce4 there was no way to put default keyboard settings using any command even using the UI keyboard configuration of xfce4... BUT... this worked just fine:

echo '
# Set default keyboard for X:
sleep 2
if [ -n $DISPLAY ] ; then
    setxkbmap -model pc105 -layout es -variant winkeys -print | xkbcomp - $DISPLAY
' \
 | sudo tee -a ~/.xsessionrc

the sleep command is mandatory in order to get it working.


This worked for me:

sudo dpkg-reconfigure keyboard-configuration
sudo service keyboard-setup restart

And then restart

  • not for me -- it was the first thing I tried and surely I tried restarting it. – ribamar Oct 6 '18 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.