0

There is a lspci failed message when I text the lspci command lspci

lspci: Line too long at /usr/share/misc/pci.ids, line 1

so I try other command to show the line number

sed -n 1p /usr/share/misc/pci.ids | wc -c

1210291

cat /usr/share/misc/pci.ids | awk '{ print length }' | sort -n | tail -1

1210291

(In the normal machine only get 167)

The machine data is:

  • lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal
  • uname -r
5.11.0-40-generic

lspci version:

lspci version 3.6.4

How do I fix this problem or there is a workaround?

There is samilary discussion in raspberry pi page

laudai
  • 35
  • 1
    try apt install --reinstall pci.ids – Bravo Dec 01 '21 at 05:35
  • same discussion in raspberry pi page - that's on a different line though – Bravo Dec 01 '21 at 05:39
  • I mean there is a the same like the link. I modified the question later. – laudai Dec 01 '21 at 07:08
  • 1
    I understand, but line 1 being over a million bytes is a little different to line 23,610 being "too long" ... your pci.ids file seems to be absolutely busted - have you inspected it? it should be plain text. Perhaps this is an indication of a failing sd card (I assume you're running this on a pi) – Bravo Dec 01 '21 at 07:16
  • https://unix.stackexchange.com/questions/419155/raspberry-booting-from-a-usb-pen-instead-of-an-sd-card/419156 – Rui F Ribeiro Dec 01 '21 at 08:47
  • @Bravo My Ubuntu 20.04 installed on USB stick. And there is all 1329 good 1 is this problem. You are right. This file look likes not totally a plain text file. Although use file /usr/share/misc/pci.ids command get return data text. Maybe this file in this USB is broken I guess. – laudai Dec 02 '21 at 02:23
  • have you tried apt install --reinstall pci.ids – Bravo Dec 02 '21 at 02:26
  • It look like something error after this reinstall command. I will try to fix it.
     files list file for package 'libgdk-pixbuf2.0-common' is missing final newline
    E: Sub-process /usr/bin/dpkg returned an error code (2)
    
    – laudai Dec 03 '21 at 01:15

0 Answers0