I was trying to edit a keyboard layout in Ubuntu 14.04, but it wasn't accepting the changes.

  • I looked it up and found I needed to delete /var/lib/xkb to make the change take effect. I did that and it still hadn't taken effect, but nothing had changed either.
  • I looked further and found I had to do sudo restart lightdm. I did that and it did its thing, but when I tried to log back in, I couldn't type.
  • I shut down and tried again, but I still couldn't type. I went to onscreen keyboard and it said No X keyboard found, retrying…

I don't even have a USB keyboard or anything, it's a laptop with the keyboard built in. I can't do anything because my keyboard doesn't work and I have no idea what to do. Help!

  • Open Onboard then type login password
    – sohel4r
    May 1, 2014 at 0:20
  • I don't know if I have Onboard installed. I also don't know how I would access it from the login screen.
    – AxolotlEmu
    May 1, 2014 at 0:25
  • top right corner
    – sohel4r
    May 1, 2014 at 0:28
  • If you mean onscreen keyboard from the accessibility drop down menu, that seems to be broken too. It has no keyboard found and it's all question marks. Otherwise, I'm not quite sure what you mean.
    – AxolotlEmu
    May 1, 2014 at 0:30
  • In addition, I logged in on a guest account and still can't use the keyboard. Everything else works and it shows that I'm using the English keyboard, but nothing I type is being received.
    – AxolotlEmu
    May 1, 2014 at 0:32

6 Answers 6


Just had this happen. I was editing /usr/share/X11/xkb/symbols/pc (remapping alt to ctrl) but forgot a semicolon and could not use my keyboard to log in.

I restarted using GRUB to select recovery mode and then root terminal mode. Keyboard worked in the simple root terminal and I was able to edit and fix .../pc. Phew!


I had the same happen after making some (apparently) bad changes to /usr/share/X11/xkb/symbols/pc and rm /var/lib/xkb/*.xkm.

I ended up being able to recover by logging in as guest, clicking open the wifi menu, clicking Connection Information, getting the IPv4 address, and ssh'ing in from my other computer. Then I undid my bad changes to pc, quit the ssh connection, and restarted the Ubuntu box. The keyboard worked normally when the login screen came back up.

Note that this wouldn't have worked if I had been following decent security practices and not allowed root via ssh, but this was a fairly new install and I hadn't gotten around to that yet.


Had the same problem. Reinstalled xkb-data package using Ubuntu Software Center (by mouse only) and it was fixed.
The package can be found here: http://packages.ubuntu.com/search?keywords=xkb-data


I have resolved the same problem by creating a text file with the password on a USB key using a different computer, and then inserting the USB key and copy-pasting the password from the text file using mouse only. Then I reinstalled xkb-data using the answer above and synaptic. It worked.

If you do not have autologin, this possibility might not work for you, since I do not think the USB key gets automounted if you are not logged in. Then I think you could just restart the computer, choose recovery mode from Grub and then enter as superuser. The keyboard should work here. Then:

  • Remount the filesystem as read/write:
mount -o remount,rw /
  • Use apt-get to reinstall
sudo apt-get install --reinstall xbd-data

I did not have to try it this way, but this should work too I think.


I had the same problem when I edited the US layouts. Ctrl+Alt+F1-7 weren't working on my default layout.

My solution was to switch to a secondary non-English layout I had installed, use Ctrl+Alt+F1-7, then log in normally and run sudo apt-get install --reinstall xkb-data.

Word of advice to anyone messing with custom layouts - always have a secondary backup layout enabled for stuff like this. Latin letters are preferable but whatever allows you to use Ctrl+Alt+F1-7 works.


I was also struggling with this and solved it by just using an ubuntu live usb disk and replacing the keyboard symbols/pc file by the default one. A simple solution, but it took me a while before I thought of it so I hope this helps other people.

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.