rpm -qa vs yum list installed: Why certain packages can be found with rpm -qa only?

问题现象

Python 2.7.5 是存在的。rpm -qa 可以成功查询,但是 yum list installed却没查到。

[root@CentOS7 centos]# python -VPython 2.7.5[root@CentOS7 centos]# [root@CentOS7 centos]# rpm -qa | grep python-2.7.5python-2.7.5-58.el7.x86_64[root@CentOS7 centos]#[root@CentOS7 centos]# yum list installed | grep python-2.7.5[root@CentOS7 centos]# 

yum list installed 介绍

the package nameversion numberthe repository nickname
audit-libs-python.x86_642.7.6-3.el7@base
dbus-python.x86_641.1.1-9.el7installed
libselinux-python.x86_642.5-11.el7@base
libsemanage-python.x86_642.5-8.el7@base
libxml2-python.x86_642.9.1-6.el7_2.3installed
newt-python.x86_640.52.15-4.el7installed
policycoreutils-python.x86_642.5-17.1.el7@base
python.x86_642.7.5-58.el7@base
rpm-python.x86_644.11.3-25.el7@base

yum list installed 查出结果如上分三列显示,可以针对单独某列进行查询,比如

[root@user1 ~]# yum list installed | grep 2.7.5python.x86_642.7.5-58.el7@basepython-libs.x86_64 2.7.5-58.el7@base
[root@user1 ~]# yum list installed | grep python.x86_64audit-libs-python.x86_64 2.7.6-3.el7 @basedbus-python.x86_64 1.1.1-9.el7 installedlibselinux-python.x86_64 2.5-11.el7@baselibsemanage-python.x86_642.5-8.el7 @baselibxml2-python.x86_642.9.1-6.el7_2.3 installednewt-python.x86_64 0.52.15-4.el7 installedpolicycoreutils-python.x86_642.5-17.1.el7@basepython.x86_642.7.5-58.el7@baserpm-python.x86_644.11.3-25.el7 @base 
yum list installed | grep python-2.7.5 不支持,需要使用特殊结构查询,这里不展开,可自行查询

rpm -qa 介绍

[root@user1 ~]# rpm -qa | grep 2.7.5python-libs-2.7.5-58.el7.x86_64python-2.7.5-58.el7.x86_64[root@CentOS7 centos]# rpm -qa | grep python-2.7.5python-2.7.5-58.el7.x86_64

参考

rpm -qa vs yum list installed: Why certain packages can be found with rpm -qa only?