After installing Lubuntu on an older laptop (C500 Presario Compaq) I have found that I am completely unable to change the keyboard layout! I have tried the following:

  1. Select keyboard from Keyboard Layout Handler in taskbar - FAILED as it does not exist.

  2. run setxkbmap -layout us - this works, but only until next reboot - FAIL

  3. echo '@setxkbmap -option grp:alt_shift_toggle "es, us"' | sudo tee -a /etc/xdg/lxsession/Lubuntu/autostart - FAILED makes no difference, even if I set to "us, us" as I don't want to toggle, just want $$%$^$ us language keyboard.

  4. Older versions of Lubuntu had preferences->lxkeymap but not in latest version, so any attempt to use that - FAILED

  5. Tried to edit /etc/default/keyboard. can see it's set incorrectly to uk, but cannot change it through GUI as directory is write protected. Cannot change via terminal window, because the keyboard is too screwed up to run vim correctly - FAILED

  6. Go to Menu->Preferences->Keyboard input Methods. - FAILED it does not exist. Only a Preferences -> Keyboard and Mouse, and the keyboard section contains nothing useful.

Honestly, how hard can it be to configure a keyboard?!! I am running the very latest version of lubuntu with all updates as at 23 March 2017.

1 Answer 1


setxkbmap can be used, but as you've seen needs to be run at the start of every X session.

# add "-model modelname" if desired
setxkbmap -layout us

You can add it several places:

  • $HOME/.config/lxsession/Lubuntu/autostart

    • copied from system location if doesn't exist
  • /etc/xdg/lxsession/Lubuntu/autostart:

    • a system default for future users
    • users who have their own autostart file already will not automatically get changes
  • $HOME/.xprofile

    • automatically run at GUI login by many sessions

There appear to be several Compaq models available, so you may want to test them (with setxkbmap -model <modelname>) to see if one works better than others:

$ localectl list-x11-keymap-models | grep -i -e compaq -e presario

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .