Home » Middleware Libraries, HAL » Userspace Utilities » usbutils: How to Compile, Install, and Use USB Userspace Utilities on Ubuntu

usbutils: How to Compile, Install, and Use USB Userspace Utilities on Ubuntu

usbutils is a package of USB utilities for Linux that provides various command-line tools for listing and managing USB devices. This guide will walk you through the steps to compile, install, and use usbutils on an Ubuntu system.

Introduction to usbutils

usbutils is a collection of utilities that help you interact with and manage USB devices on your Linux system. The package includes tools like lsusb, which lists USB devices, and other utilities that provide detailed information about connected USB hardware.

Step-by-Step Guide to Compile and Install usbutils on Ubuntu

Step 1: Update Your System

Before starting, ensure your system is up-to-date by running the following commands:

sudo apt update
sudo apt upgrade

Step 2: Install Required Dependencies

You need several dependencies to compile usbutils. Install them using the following command:

sudo apt install build-essential libusb-1.0-0-dev autoconf automake git

Step 3: Download usbutils Source Code

Clone the usbutils repository from GitHub:

git clone https://github.com/gregkh/usbutils.git
cd usbutils

Step 4: Compile usbutils

Run the following commands to compile the source code:

autoreconf --install
./configure
make

Step 5: Install usbutils

Once compiled, install usbutils using the following command:

sudo make install

Using usbutils on Ubuntu

After installation, you can start using the usbutils tools. Here are some common commands:

lsusb

The lsusb command lists all USB devices connected to your system. This is one of the most commonly used tools in the usbutils package.

lsusb

Output:

Bus 002 Device 003: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 003: ID 04f2:b3aa Chicony Electronics Co., Ltd Integrated Camera
Bus 001 Device 004: ID 8087:07da Intel Corp. 
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

usb-devices

The usb-devices command provides detailed information about all connected USB devices.

usb-devices

Output will include detailed information like the device class, manufacturer, and product ID.

usbview

usbview is a graphical interface that provides a tree view of all USB devices connected to your system. To use usbview, you need to install it separately:

sudo apt install usbview
usbview

Troubleshooting Common Issues

If you encounter any issues while compiling or installing usbutils, here are some troubleshooting tips:

  1. Missing Dependencies: Ensure all required dependencies are installed. Recheck the list of dependencies and install any that are missing.
  2. Permission Issues: Some commands may require root permissions. Use sudo where necessary.
  3. Compilation Errors: If you encounter errors during compilation, clean the build environment using make clean and try recompiling.

Conclusion

usbutils is an essential package for managing USB devices on Linux. By following this guide, you can compile, install, and use usbutils on your Ubuntu system. With tools like lsusb, usb-devices, and usbview, you can effectively manage and troubleshoot USB devices, enhancing your system management capabilities.


Subscribe our Rurban Life YouTube Channel.. "Rural Life, Urban LifeStyle"

Leave a Comment