解决CentOS系统使用lspci命令查看PCI设备(Command not found)方法

原因

  • 是因为CentOS系统最小化安装之后,相应的软件包没有进行安装。

  • 需要手动去安装之后再使用lspci命令

解决办法

  1. 在终端内执行下面的命令

    yum whatprovides */lspci
  2. 得到如下回应

  3. 继续复制下面的命令粘贴到终端内

    yum install pciutils
  4. 中间提示的时候输入 y 确认

  5. 然后你就可以使用lscpi命令了

  6. 下面是完整的操作命令过程

    [root@localhost ~]# lspci -v
    -bash: lspci: 未找到命令
    [root@localhost ~]# yum whatprovides */lspci
    已加载插件:fastestmirror
    Repository base is listed more than once in the configuration
    Repository updates is listed more than once in the configuration
    Repository extras is listed more than once in the configuration
    Repository centosplus is listed more than once in the configuration
    Repository contrib is listed more than once in the configuration
    Loading mirror speeds from cached hostfile
     * base: mirrors.aliyun.com
     * extras: mirrors.aliyun.com
     * updates: mirrors.aliyun.com
    docker-ce-stable/7/x86_64/filelists_db                                 |  60 kB  00:00:00
    extras/7/x86_64/filelists_db                                           | 345 kB  00:00:00
    updates/7/x86_64/filelists_db                                          |  14 MB  00:00:15
    pciutils-3.5.1-3.el7.x86_64 : PCI bus related utilities
    源    :base
    匹配来源:
    文件名    :/usr/sbin/lspci
    
    
    
    [root@localhost ~]# yum install pciutils
    已加载插件:fastestmirror
    Repository base is listed more than once in the configuration
    Repository updates is listed more than once in the configuration
    Repository extras is listed more than once in the configuration
    Repository centosplus is listed more than once in the configuration
    Repository contrib is listed more than once in the configuration
    Loading mirror speeds from cached hostfile
     * base: mirrors.aliyun.com
     * extras: mirrors.aliyun.com
     * updates: mirrors.aliyun.com
    正在解决依赖关系
    --> 正在检查事务
    ---> 软件包 pciutils.x86_64.0.3.5.1-3.el7 将被 安装
    --> 解决依赖关系完成
    
    依赖关系解决
    
    ==============================================================================================
     Package               架构                版本                       源                 大小
    ==============================================================================================
    正在安装:
     pciutils              x86_64              3.5.1-3.el7                base               93 k
    
    事务概要
    ==============================================================================================
    安装  1 软件包
    
    总下载量:93 k
    安装大小:196 k
    Is this ok [y/d/N]: y
    Downloading packages:
    pciutils-3.5.1-3.el7.x86_64.rpm                                        |  93 kB  00:00:00
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      正在安装    : pciutils-3.5.1-3.el7.x86_64                                               1/1
      验证中      : pciutils-3.5.1-3.el7.x86_64                                               1/1
    
    已安装:
      pciutils.x86_64 0:3.5.1-3.el7
    
    完毕!
    [root@localhost ~]# lspci -v    #查看你的pci设备
    

功德+1(狗子).gif

👇👇👇