E: Unable to locate package linux-tools-5.4.0-77-generic on WSL Debian 11

I'm following this oficial guide to Connecting USB devices to WSL2 but I'm stuck installing linux-tools-5.4.0-77-generic. I'm executing the $ sudo apt install linux-tools-5.4.0-77-generic command but it gaves me the next error:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-tools-5.4.0-77-generic
E: Couldn't find any package by glob 'linux-tools-5.4.0-77-generic'

I've tried:

  1. $ sudo apt upgrade.
  2. $ sudo apt update.
  3. Editing /etc/apt/sources.list manually.
  4. Download the binary files from https://ubuntu.pkgs.org/18.04/ubuntu-updates-main-amd64/linux-tools-5.4.0-77-generic_5.4.0-77.86~18.04.1_amd64.deb.html and installing manually with $ sudo apt install ./path/to/binary.file.deb.

Please follow the next github issue to get more details about my WSL environment.

Issue on WSL.

Thanks in advance, I'm still learning about WSL.


This turns out to be even easier in Debian than in Ubuntu. Simply:

sudo apt install usbip hwdata usbutils

There's no need to modify sudoers with visudo since Debian installs usbib to /usr/sbin (which is already in the secure_path.

Given the above, and assuming Debian is your default WSL instance, then the rest of the instructions (e.g. usbipd wsl) should work.

However, at this point, the usbipd wsl only seems to work with the default WSL instance. If Debian is not your default WSL distribution (as noted by wsl -l -v), then you just need to set things up in two stages.

First, share/bind the device from Windows (in an Administrator prompt):

usbipd list
usbipd bind --busid <bus-id>

Then attach to it from inside Debian via:

sudo usbip attach -r $HOSTNAME.local -b <bus-id>

The $HOSTNAME.local uses mDNS to connect to the Windows host.

lsusb should then show the device.