Refresh Linux PCI IDs Safely with update-pciids
You will refresh the local PCI ID database used by tools such as lspci, then verify that the new file is present and readable. The command downloads the list from the PCI ID project's distribution site and replaces the installed copy only after basic checks succeed.
The route
Jump straight to the step you need, or tick off Done means at the end.
This guide describes the pciutils 3.10.0 command installed from package version 1:3.10.0-2build1. Allow about ten minutes, including a few minutes to investigate a network or permission problem if one appears.
You need a shell, network access to the distribution site, and one of curl, wget or lynx. Updating /usr/share/misc/pci.ids normally requires elevated privileges. The examples use sudo for that one state-changing operation; use your system's approved privilege method if it differs.
1. Check the installed command
Confirm which executable will run and identify the installed package. These checks are ordinary and do not change anything:
$ command -v update-pciids
/usr/sbin/update-pciids
$ dpkg-query -W -f='${Package} ${Version}\n' pciutils
pciutils 1:3.10.0-2build1
Your package version may differ. The local manual for this installation identifies the utility as pciutils-3.10.0, and documents only one option, -q. Do not add flags copied from a different distribution's wrapper without checking that version's manual.
Checkpoint
The command resolves to the executable you intended, and the package query identifies pciutils.
2. Check the destination and download helper
The destination is /usr/share/misc/pci.ids. Check whether it exists, whether it is readable, and which supported downloader is available:
$ ls -l /usr/share/misc/pci.ids
$ command -v curl || command -v wget || command -v lynx
/usr/bin/curl
The final command prints the first matching helper. If it prints nothing, the update cannot start. Install or enable one of the helpers through your normal system administration process, then rerun this check. The utility prefers curl, then wget, then lynx.
Also check that the destination is writable by the account that will run the update:
$ test -w /usr/share/misc/pci.ids && echo writable || echo 'not writable by this account'
not writable by this account
Seeing not writable is common for an administrator-owned file. It is a reason to use sudo for the update, not a reason to loosen the directory's permissions.
3. Run the update
Warning
This step changes the system-wide PCI ID list. It does not change device firmware or kernel drivers, but programs that read the list can show different vendor and device names afterwards. Keep the current file until the replacement has passed the utility's checks, and do not run this during an unrelated maintenance task where changed hardware labels could confuse diagnosis.
Run the normal, visible form:
$ sudo update-pciids
Done.
The command chooses a compressed download when bzip2 or gzip is available, downloads a temporary file, decompresses it, checks for PCI class information, and moves the checked result into place. It keeps the previous file as /usr/share/misc/pci.ids.old while the update succeeds.
For a quiet scheduled or scripted invocation, use the documented option:
$ sudo update-pciids -q
$ printf 'exit status: %s\n' "$?"
exit status: 0
-q suppresses normal progress and success output. It does not suppress errors. Treat the exit status as the primary result in a script.
4. Verify the replacement
Check the file timestamp, size and first few lines without modifying it:
$ ls -lh /usr/share/misc/pci.ids
$ sed -n '1,5p' /usr/share/misc/pci.ids
0001 Intel Corporation
0002 National Semiconductor Corporation
0003 Toshiba Corporation
0004 SCO
0005 IBM
The vendor entries and exact ordering can change. The useful checks are that the file is non-empty, readable, and looks like a PCI ID list rather than an HTML error page. A quick structural check looks for the class-information marker used by the updater:
$ grep -m 1 '^C ' /usr/share/misc/pci.ids
C 00 Unclassified device
Finally, ask lspci to read the database while listing a device:
$ lspci | sed -n '1,5p'
00:00.0 Host bridge: ...
The hardware and wording are host-specific, so do not compare the sample line literally. This command verifies that the normal PCI listing path still works. It does not prove that every name has changed or that a driver has been updated.
5. Recover from a failed update
If the download fails, the utility reports an error and removes its temporary download. If decompression or the class-information check fails, stop and investigate rather than copying a partial file over the destination. Inspect the destination and retained backup:
$ ls -l /usr/share/misc/pci.ids /usr/share/misc/pci.ids.old
$ grep -m 1 '^C ' /usr/share/misc/pci.ids
C 00 Unclassified device
If the current file still has the expected marker, retry after checking connectivity and the available downloader. A proxy, captive portal or interrupted transfer can make a downloaded response unusable even when the network command itself starts successfully.
If the destination is read-only, the utility exits before downloading. Check the mount and permissions with read-only commands:
$ findmnt -T /usr/share/misc/pci.ids -o TARGET,FSTYPE,OPTIONS
$ namei -l /usr/share/misc/pci.ids
Restore normal administrative write access through your existing change process, then rerun the update. Do not delete pci.ids.old as a first response: it is the simplest local rollback copy.
If you need to restore the previous list after a successful update, preserve the current file first and then replace it with the backup during a controlled maintenance window:
$ sudo cp --preserve=all /usr/share/misc/pci.ids /usr/share/misc/pci.ids.newer
$ sudo cp --preserve=all /usr/share/misc/pci.ids.old /usr/share/misc/pci.ids
$ grep -m 1 '^C ' /usr/share/misc/pci.ids
C 00 Unclassified device
This rollback changes the shared database again. Keep pci.ids.newer until you have finished comparing results, then remove it only when its contents are no longer needed.
Done means
pciutilsand the installedupdate-pciidscommand were identified.- A supported downloader was available and the destination was checked.
sudo update-pciidscompleted with a successful status./usr/share/misc/pci.idsis readable, non-empty and contains class information.lspcistill produces a normal listing.- The retained
pci.ids.oldfile has not been discarded before the new list was trusted.