update-usbids
Update the USB device ID list
SYNOPSIS
update-usbids [options]
PARAMETERS
-h, --help
Displays a help message and exits.
-v, --version
Shows the version information of the command and exits.
-q, --quiet
Suppresses all output messages, making it suitable for silent execution in scripts or cron jobs.
-u, --update
Forces an update only if the installed USB ID list is older than the one available online. This is often the default behavior.
-f, --force
Forces the download and installation of the USB ID list, even if the local version is newer or the same as the remote one.
-s URL, --source=URL
Specifies an alternative URL from which to download the usb.ids file. Useful if the default source is unavailable or a local mirror is preferred.
-o FILE, --output=FILE
Specifies a custom output file path where the downloaded usb.ids list should be saved, overriding the default system location (e.g., /usr/share/hwdata/usb.ids).
DESCRIPTION
The update-usbids command is a utility designed to download and update the local usb.ids file. This file contains a comprehensive list of known USB vendor, product, and interface IDs, along with their corresponding human-readable names.
Tools like lsusb rely on this database to display meaningful information about connected USB devices, rather than just raw hexadecimal IDs. As new USB devices are constantly released, the usb.ids file needs to be regularly updated to ensure that these devices are correctly identified.
update-usbids typically fetches the latest version of the usb.ids list from a designated online source (often the Linux USB ID repository). By default, it performs an update only if the remote version is newer than the currently installed one. This command is frequently scheduled to run automatically via cron jobs to keep the system's USB ID database current, preventing lsusb and other utilities from showing 'Unknown' devices for new hardware.
CAVEATS
Using update-usbids requires network connectivity to download the latest USB ID list. To install the updated file to system directories (e.g., /usr/share/hwdata/usb.ids), the command typically needs to be executed with root privileges.
AUTOMATIC UPDATES AND CRON JOBS
update-usbids is frequently configured to run as a daily or weekly cron job. This ensures that the system's USB ID database is always up-to-date without requiring manual execution. For example, a common cron entry might look like:
0 3 * * * /usr/sbin/update-usbids --quiet
This command would run quietly at 3:00 AM every day, checking for and installing the latest USB ID list.
THE IMPORTANCE OF USB.IDS
The usb.ids file acts as a dictionary for USB devices. Without it, tools like lsusb would only show generic vendor and product IDs (e.g., ID 1234:5678). The usb.ids file translates these into human-readable names (e.g., ID 1234:5678 Microsoft Corp. Optical Mouse), significantly improving system administration and troubleshooting by making device identification straightforward.
HISTORY
The update-usbids command is part of the usbutils or hwdata package, which provides utilities for inspecting USB devices. Its development is tied to the need for human-readable identification of USB hardware. As the number of USB devices proliferated, maintaining an up-to-date database became essential. This command was created to automate the process of keeping the usb.ids file current, ensuring that new devices are recognized without manual intervention. It has been a standard component in many Linux distributions for years, facilitating robust USB device management.