Home / Alt manpages / update-pciids(8)

  • update-pciids(8)
  • Admin command
  • linux

Refresh Linux PCI IDs Safely with update-pciids

lspci showing numeric IDs instead of vendor names usually means update-pciids needs a run. This guide describes the pciutils 3.10.0 command installed from package version 1:3.10.0-2build1, which downloads the current list from the PCI ID project and swaps it in only after basic checks pass.

You will refresh the local PCI ID database that tools like lspci read, then verify the new file is present and readable. Allow about ten minutes, including a few spare for a network or permission hiccup.

  • A shell, network access to the distribution site, and one of curl, wget or lynx.
  • Elevated privileges to update /usr/share/misc/pci.ids. The examples use sudo for that one state-changing step.

1. Check the installed command

Confirm which executable will run and identify the installed package. Ordinary checks, nothing changes:

$ 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 identifies the utility as pciutils-3.10.0 and documents exactly one option, -q. Do not copy flags from another distribution's wrapper without checking that version's manual first.

Checkpoint

The command resolves to the executable you intended, and the package query confirms 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. Nothing printed means the update cannot start: install or enable one of the helpers through your normal administration process, then rerun this check. The utility tries curl first, then wget, then lynx.

Also check that the destination is writable by the account running the update:

$ test -w /usr/share/misc/pci.ids && echo writable || echo 'not writable by this account'
not writable by this account

not writable is expected 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 changes the system-wide PCI ID list. It does not touch device firmware or kernel drivers, but programs reading the list can show different vendor and device names afterwards. Keep the current file until the replacement passes the utility's own checks, and avoid running this mid an unrelated maintenance task where changed hardware labels could confuse diagnosis.

Run the normal, visible form:

$ sudo update-pciids
Done.

The command picks a compressed download when bzip2 or gzip is available, downloads a temporary file, decompresses it, checks for PCI class information, and only then 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, but not 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 anything:

$ 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

Vendor entries and ordering can change; what matters is 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 the updater relies on:

$ 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 that sample line literally. This confirms the normal PCI listing path still works, not that every name changed or a driver was updated.

5. Recover from a failed update

If the download fails, the utility reports an error and removes its temporary download on its own. If decompression or the class-information check fails, stop and investigate rather than copying a partial file over the destination:

$ 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 leave a downloaded response unusable even when the network command itself starts fine.

If the destination is read-only, the utility exits before downloading anything. 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.

Recovery

To restore the previous list after a successful update, preserve the current file first, then swap in 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, so keep pci.ids.newer until you have finished comparing results, and remove it only once its contents are no longer needed.

Done means

  • Identified the command and package. pciutils and the installed update-pciids.
  • Confirmed a downloader and the destination. A supported helper was available and the target was checked.
  • The update completed successfully. sudo update-pciids exited clean.
  • The new file checks out. /usr/share/misc/pci.ids is readable, non-empty and holds class information.
  • lspci still works normally. The listing path was confirmed after the update.
  • The retained backup is untouched. pci.ids.old has not been discarded before the new list was trusted.