WSL: Unable to locate package linux-tools-5.4.0-77-generic

Version

Microsoft Windows [Versión 10.0.22000.282]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.60.1

Distro Version

Debian 11 amd64

Other Software

No response

Repro Steps

I’m trying to follow this official guide to be able of talk with devices over COM ports. I’ve already updated to Windows 11 and last version of WSL2 kernel.

I’m stuck installing linux-tools-5.4.0-77-generic. I’ve already installed hwdata as the guide suggests.

I’ve tried:

  • $ sudo apt upgrade.
  • $ sudo apt update.
  • Editing /etc/apt/sources.list manually.
  • 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.

But nothing works. Good internet connection.

Expected Behavior

Install the required packet with the command $ sudo apt install linux-tools-5.4.0-77-generic.

Actual Behavior

Execute $ sudo apt install linux-tools-5.4.0-77-generic gave me the following output:

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'

Diagnostic Logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Your command is wrong bruh! just type apt install linux-tools-generic it will automatically detect the newest version on its own don’t specify that don’t do change in any config

hi. same issue with ubuntu 20.04 on windows 11. tried the command sudo apt install usbip hwdata usbutils same output as described by @mbratch

also tried the following:

  • run usbip directly, and got this suggestion:
Command 'usbip' not found, but can be installed with:
sudo apt install linux-intel-iotg-tools-common  # version 5.15.0-1016.21, or
sudo apt install linux-nvidia-tools-common      # version 5.15.0-1007.7
sudo apt install linux-tools-common             # version 5.15.0-52.58

  • next, run sudo apt install linux-tools-common. it installs fine and afterwards running usbip:
WARNING: usbip not found for kernel 5.15.68.1-microsoft

  You may need to install the following packages for this specific kernel:
    linux-tools-5.15.68.1-microsoft-standard-WSL2
    linux-cloud-tools-5.15.68.1-microsoft-standard-WSL2

  You may also want to install one of the following packages to keep up to date:
    linux-tools-standard-WSL2
    linux-cloud-tools-standard-WSL2
  • i’ve also tried to install the aforementioned packages, but they are not found by apt:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-tools-standard-WSL2
  • nor when using explicit kernel version:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-tools-5.15.68.1-microsoft-standard-WSL2
E: Couldn't find any package by glob 'linux-tools-5.15.68.1-microsoft-standard-WSL2'

I’ve posted an answer on your Super User question, but to summarize the changes needed for Debian:

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.

@Sudococommunity yes that command works but it does nothing to the relevant issue: the command usbip is not found. sudo apt install linux-tools-generic

The following additional packages will be installed:
  linux-tools-5.15.0-52 linux-tools-5.15.0-52-generic
The following NEW packages will be installed:
  linux-tools-5.15.0-52 linux-tools-5.15.0-52-generic linux-tools-generic
0 upgraded, 3 newly installed, 0 to remove and 19 not upgraded.
...
Setting up linux-tools-5.15.0-52 (5.15.0-52.58) ...
Setting up linux-tools-5.15.0-52-generic (5.15.0-52.58) ...
Setting up linux-tools-generic (5.15.0.52.52) ...

next usbip

WARNING: usbip not found for kernel 5.15.68.1-microsoft

  You may need to install the following packages for this specific kernel:
    linux-tools-5.15.68.1-microsoft-standard-WSL2
    linux-cloud-tools-5.15.68.1-microsoft-standard-WSL2

  You may also want to install one of the following packages to keep up to date:
    linux-tools-standard-WSL2
    linux-cloud-tools-standard-WSL2

so we are back at the starting point and none of the suggested alternatives work

@NotTheDr01ds

Attempt to run this:

sudo apt install usbip hwdata usbutils

Results in this:

Package usbip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'usbip' has no installation candidate

@Sudococommunity yes that command works but it does nothing to the relevant issue: the command usbip is not found. sudo apt install linux-tools-generic

The following additional packages will be installed:
  linux-tools-5.15.0-52 linux-tools-5.15.0-52-generic
The following NEW packages will be installed:
  linux-tools-5.15.0-52 linux-tools-5.15.0-52-generic linux-tools-generic
0 upgraded, 3 newly installed, 0 to remove and 19 not upgraded.
...
Setting up linux-tools-5.15.0-52 (5.15.0-52.58) ...
Setting up linux-tools-5.15.0-52-generic (5.15.0-52.58) ...
Setting up linux-tools-generic (5.15.0.52.52) ...

next usbip

WARNING: usbip not found for kernel 5.15.68.1-microsoft

  You may need to install the following packages for this specific kernel:
    linux-tools-5.15.68.1-microsoft-standard-WSL2
    linux-cloud-tools-5.15.68.1-microsoft-standard-WSL2

  You may also want to install one of the following packages to keep up to date:
    linux-tools-standard-WSL2
    linux-cloud-tools-standard-WSL2

so we are back at the starting point and none of the suggested alternatives work

A few things did to get it to work:

  1. Followed and used the commands from https://github.com/dorssel/usbipd-win/wiki/WSL-support supplied by @Sudococommunity.
  2. Then you run usbipd in Powershell Administrator mode, not WSL bash
  3. Follow the rest of the guide from the original Microsoft page https://learn.microsoft.com/en-us/windows/wsl/connect-usb for instructions on how to attach and detach. These commands need to be run in Powershell. I spent way to long trying to figure out why bash wasn’t working.
  4. Run lsusb in WSL bash and the device should be listed.

installed linux-tools-generic and worked. Problem is ‘linux-tools-5.4.0-77-generic’ is in the official guide of WSL which I think is inappropriate

Instructions are still unchanged. At the moment, linux-tools-generic installs version 5.15.0-58-generic, while the kernel after wsl --update is 5.15.79.1-microsoft-standard-WSL2. Running usbip give a message suggesting to install either linux-tools-5.15.79.1-microsoft-standard-WSL2 or linux-tools-standard-WSL2, but there are no packages available with those names.

Workaround /usr/bin/usbip and usbipd are actually just scripts, which check for the “correct” version. That check seems to be very specific. As a workaround I removed /usr/bin/usbip and /usr/bin/usbipd, and symlinked /usr/lib/linux-tools/5.15.0-58-generic/usbip and /usr/lib/linux-tools/5.15.0-58-generic/usbipd to /usr/bin. Kernel is version 5.15.x and linux-tools is version 5.15.x, which I presume is close enough to work, and in practice it does.

sudo update-alternatives --install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 20
sudo update-alternatives --install /usr/local/bin/usbipd usbipd `ls /usr/lib/linux-tools/*/usbipd | tail -n1` 20

by the way method you all are using to install usbip is wrong actually this command differ in wsl which is named as usbipd and to revoke the usbipd command just type usbipd --help but this will not work until you don’t setup your wsl for this ( kernal you have installed for wsl has nothing to do with it no config will help out and the pakage is mentioned in error as well funny!! ) Go to this blog read it if problem persist than come back I help you out https://github.com/dorssel/usbipd-win/wiki/WSL-support

Ever figure this out?

foo@FOO-PC:/mnt/c/WINDOWS/system32$ sudo apt install linux-tools-5.4.0-77-generic hwdata [sudo] password for foo: Reading package lists… Done Building dependency tree Reading state information… Done E: Unable to locate package linux-tools-5.4.0-77-generic

This issue has been automatically closed since it has not had any activity for the past year. If you’re still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

I have installed linux-tools-generic successfully, but it seems that some weird WSL-only command aliasing is preventing me from running any program from it.

I have added /usr/lib/linux-tools/5.15.0-69-generic to PATH in .bashrc. But if I run, for example: perf I get: WARNING: perf not found for kernel 5.15.90.1-microsoft [ . . . ] but the program exists! So if I run: /usr/lib/linux-tools/5.15.0-69-generic/perf it runs, showing: usage: perf [–version] (bla bla . . . ) The most commonly used perf commands . . . This also works if I cd /usr/lib/linux-tools/5.15.0-69-generic and then ./perf.

I have relaunched the terminal, even restarted WSL, and verified having added the directory to PATH with echo $PATH. The problem persists…

I have filed a separate issue for this: #9917