Nov 6, 2017

USB keyboard or mouse not working on Ubuntu - Disable autosuspend on every USB devices/ports

To disable autosuspend on every USB devices/ports

  1. Open Terminal and execute:

    sudo sh -c "echo -1 > /sys/module/usbcore/parameters/autosuspend"  
  2. This is indeed a temporary solution that allows you to instantly test if this command fixes your mouse or keyboard autosuspend issue
  3. If your USB device(s) work fine now, just edit your '/etc/rc.local' script so it will run that command whenever the system is booted. This way you'll make the fix kind of permanent. Edit the file, for example with nano:

    sudo nano /etc/rc.local  
  4. and put the echo -1 command in your '/etc/rc.local' file before the exit 0 line

    #!/bin/sh -e  #  # rc.local  #  # This script is executed at the end of each multiuser runlevel.  (...)  # By default this script does nothing.  echo -1 > /sys/module/usbcore/parameters/autosuspend  exit 0  
  5. Restart your computer