Ubuntu Mate 16.4.2 LTS外接USB键鼠突然失灵求解决方案
Hey there, let's work through this frustrating USB input device issue you're facing. Since you already know the sleep-wake trick works temporarily, let's dive into permanent fixes tailored to your setup:
System Context Recap
- OS: Ubuntu Mate 16.4.2 LTS
- Laptop: Dell Latitude E6420
- Kernel: 4.13.0-32-generic (same issue on 4.13.0-26-generic)
- Symptom: USB keyboard/mouse completely unresponsive, USB drives work fine; sleep-wake resolves temporarily
Potential Permanent Solutions
1. Reload USB HID Module (Quick Fix + Automate)
Sometimes the USB human interface device (HID) module gets stuck. You can reset it manually with these commands:
sudo modprobe -r usbhid && sudo modprobe usbhid
To make this easier, you can create a simple shell script or assign a keyboard shortcut to run these commands if the issue pops up before a permanent fix is found.
2. Disable USB Auto-Suspend (Power Management Tweak)
Ubuntu's default power management might be putting USB ports to sleep prematurely, which can break input devices. Here's how to fix it:
- Per-device rule: First, run
lsusbto find your keyboard/mouse's vendor and product IDs (look for lines likeBus 001 Device 003: ID 046d:c31c Logitech, Inc. Keyboard K120—046dis vendor ID,c31cis product ID). Then create a udev rule:
Add this line (replacesudo nano /etc/udev/rules.d/50-usb-input-power.rulesXXXXandYYYYwith your device IDs):
Save and exit, then reboot.SUBSYSTEM=="usb", ATTR{idVendor}=="XXXX", ATTR{idProduct}=="YYYY", TEST=="power/control", ATTR{power/control}="on" - Global disable: If you don't want to target specific devices, edit
/etc/rc.localand add this line beforeexit 0:
Reboot to apply.echo on > /sys/bus/usb/devices/*/power/control
3. Update or Adjust Your Kernel
While you've seen the issue on two 4.13.x kernels, trying a different kernel branch might resolve compatibility issues:
- Upgrade to HWE kernel: Ubuntu 16.04 supports the Hardware Enablement (HWE) kernel (4.15 series, which is more stable for newer hardware). Install it with:
sudo apt-get update && sudo apt-get install linux-generic-hwe-16.04 - Downgrade to default 4.4 kernel: If the newer kernel is the culprit, revert to Ubuntu 16.04's original LTS kernel:
After installing either option, reboot and test if the issue persists.sudo apt-get install linux-generic
4. Update Dell BIOS/Firmware
Outdated firmware can cause USB compatibility bugs. Check for updates using:
sudo apt install fwupd sudo fwupdmgr refresh sudo fwupdmgr update
Alternatively, reboot your laptop and press F2 to enter BIOS, then check for built-in update options (ensure your battery is fully charged before updating firmware).
5. Hardware Checks
Even though USB drives work, double-check:
- Try plugging your keyboard/mouse into a different USB port (switch between USB 2.0 and 3.0 if available)
- Test with a different USB keyboard/mouse to rule out device-specific issues
If none of these fixes work, gather more debug info when the issue occurs:
- Run
dmesg | grep usbto check for USB-related error messages - Run
lsusb -vand share the output for your keyboard/mouse (if possible) — this can help pinpoint driver or protocol issues.
内容的提问来源于stack exchange,提问作者user794477

