If your keyboard and mouse stop working in Ubuntu 20.04 LTS, the fix is usually a USB driver issue, a kernel regression, or a GNOME settings problem. You can often restore input by switching to a different USB port, booting with a kernel parameter, or reinstalling the xserver-xorg-input-libinput package. Below are the most effective troubleshooting steps, starting with the quickest and safest.
Why This Happens on 20.04 LTS
Ubuntu 20.04 uses the 5.4 or 5.15 HWE kernel with the libinput driver for both keyboard and mouse. The most common causes of total input failure are:
- USB controller power management suspending the port (autosuspend)
- A kernel update that breaks a specific chipset (especially Realtek or ASMedia)
- GNOME’s input settings getting corrupted, often after a crash or upgrade
- Wayland session issues (though 20.04 defaults to Xorg for NVIDIA users)
- Hardware-level firmware bugs on laptops with USB-C or Thunderbolt
The problem is frequently temporary and recoverable without reinstalling. The steps below cover both the live session and the installed system.
Quick Recovery: Get a Working Cursor and Keys Right Now
If you are stuck at the login screen or on the desktop, try these in order. Each takes less than a minute.
- Unplug and replug the keyboard and mouse into a different USB port. Prefer a port directly on the motherboard (back panel) over a front-panel hub.
- Press Ctrl+Alt+F3 to switch to a text console. If that works, your hardware is fine; the issue is in the GUI. Log in and run
sudo systemctl restart gdmto restart the display manager. - Use the on-screen keyboard (if the mouse works) by clicking the accessibility icon in the top-right corner, then selecting “Screen Keyboard”.
- Boot from a live USB of Ubuntu 20.04. If the keyboard works there, the problem is in your installed system’s configuration, not the hardware.
Fix 1: Disable USB Autosuspend
Linux’s USB autosuspend can cut power to a device that is idle for a few seconds. This is the most common cause of “keyboard works for a minute, then dies.”
- Boot to a text console (Ctrl+Alt+F3) or use a live USB.
- Edit the GRUB configuration:
sudo nano /etc/default/grub - Find the line
GRUB_CMDLINE_LINUX_DEFAULTand addusbcore.autosuspend=-1inside the quotes. For example:GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1" - Run
sudo update-gruband reboot.
Fix 2: Reinstall the Input Drivers
The libinput driver is the standard for both keyboard and mouse on 20.04. If its configuration is corrupted, reinstalling it often resolves the issue.
- Get to a terminal via Ctrl+Alt+F3 or a live USB chroot.
- Run:
sudo apt updatesudo apt install --reinstall xserver-xorg-input-libinput - Also remove any stale configuration:
sudo rm -f /etc/X11/xorg.conf(only if you never created one manually) - Reboot.
Fix 3: Switch to a Different Kernel
If the problem started after a kernel update, boot the previous kernel from the GRUB menu (hold Shift during boot, select “Advanced options”). If that works, you can pin the old kernel:
- Remove the problematic kernel:
sudo apt remove linux-image-5.15.0-XX-generic(replace XX with the actual version). - Or hold the current one:
sudo apt-mark hold linux-image-generic
Fix 4: Reset GNOME Settings
Corrupted GNOME settings can disable input devices. Resetting them is safe but will revert your desktop customization.
- From a text console, run:
dconf reset -f /org/gnome/desktop/input-sources/ - Also reset the entire GNOME session:
dconf reset -f /org/gnome/(this resets all GNOME settings). - Reboot.
When Nothing Works: Reinstall the OS
If you have tried all the above and the keyboard/mouse still fail even in a live session, it is likely a hardware issue or a very early boot problem. Before reinstalling, test the devices on another computer. If they work elsewhere, try a different USB port, a powered hub, or a PS/2 adapter (if your motherboard has PS/2 ports). Reinstalling Ubuntu 20.04 is a last resort but will resolve any software corruption.
Frequently Asked Questions
Why does my keyboard work in BIOS but not in Ubuntu?
This indicates the hardware is fine. The issue is in the Linux kernel or the display server. Try the USB autosuspend fix first, then reinstall libinput. If it still fails, boot with a different kernel from GRUB.
Can I use a wireless keyboard/mouse during these fixes?
Yes, but wireless receivers are also USB devices and can be affected by the same autosuspend issue. If a wired device works, use that for the fixes. If only wireless devices fail, try moving the receiver to a different port or using a USB extension cable to reduce interference.
Will updating to a newer kernel break my input devices?
It can. The 5.15 HWE kernel (available via ubuntu-drivers install) is generally stable, but regressions do happen. If you update and lose input, boot the previous kernel and report the bug to Launchpad.
Is this a hardware failure or a software problem?
If the devices work in BIOS, in another OS, or on another computer, it is software. If they fail everywhere, it is hardware. The live USB test is the quickest way to tell.
Does Wayland cause keyboard/mouse failures?
Wayland can have input issues with certain graphics drivers, but 20.04 defaults to Xorg for NVIDIA and Wayland for AMD/Intel. If you are on Wayland, switch to Xorg at the login screen (gear icon) and test.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Apple Music Not Working via USB in Car? Fixes
- Fix Could Not Call Proc Error in Windows
- How to Customize Firefox Homepage & Startup
- How to Choose an AI Model for Your App
- Samsung Galaxy Ace vs iPhone: Key Differences
- How to Fix Hulu Error Code P-DEV318