Ubuntu – Keyboard (including on screen keyboard) doesn’t work

keyboard

I was just messing around with my laptop trying to map keys from an external keyboard to bind to the hardware brightness control settings since some of the keys on my laptop's keyboard stopped working properly.

So following some of the instructions from another post on here, I added a couple lines into /usr/share/X11/xkb/symbols/pc, and commented out what I thought to be the relevant lines. Clearly I made a huge mistake, because after I rebooted my laptop for the changes to take effect, none of the keyboard keys were working.

Even the onscreen keyboard looks super confused. All the character keys just show '?'s and the space bar says "No X keyboard found, retrying…"

Please help, otherwise I won't have any option but to reinstall from scratch on it.

I'm running Ubuntu Studio based on 19.04, on an Acer Aspire E1 model Z5WE3

Best Answer

  • Making errors in the keyboard symbol files will create problems like you mentioned.

    If you remember the changes you have done.., you can log on to Recovery mode and correct the errors..

    to do so..

    1. at Grub Menu Screen, select Advanced Options for Ubuntu and choose Recovery Mode..
    2. Select Recovery Mode from the list.. Tab to OK and Enter..
    3. type sudo nano /usr/share/X11/xkb/symbols/pc
    4. correct the errors you remembered and save the changes to the file..
    5. exit..
    6. Resume..

    If you don't remember the changes or messed up with the file.. you need to either get the file /usr/share/X11/xkb/symbols/pc from a working system or from source code and then following above points go to Recovery Mode and then

    sudo rm /usr/share/X11/xkb/symbols/pc
    sudo cp /path/to/downloaded-file-named-pc /usr/share/X11/xkb/symbols/
    

    exit..
    resume..


    A Similar Case recovery pics from Ubuntu 18.04.3

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

  • Related Question