“rpm -qa“ 和 “yum list installed“ 的区别

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 -V
Python 2.7.5
[root@CentOS7 centos]# 

[root@CentOS7 centos]# rpm -qa | grep python-2.7.5
python-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 name version number the repository nickname
audit-libs-python.x86_64 2.7.6-3.el7 @base
dbus-python.x86_64 1.1.1-9.el7 installed
libselinux-python.x86_64 2.5-11.el7 @base
libsemanage-python.x86_64 2.5-8.el7 @base
libxml2-python.x86_64 2.9.1-6.el7_2.3 installed
newt-python.x86_64 0.52.15-4.el7 installed
policycoreutils-python.x86_64 2.5-17.1.el7 @base
python.x86_64 2.7.5-58.el7 @base
rpm-python.x86_64 4.11.3-25.el7 @base

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

[root@user1 ~]# yum list installed | grep 2.7.5
python.x86_64                          2.7.5-58.el7                    @base    
python-libs.x86_64                     2.7.5-58.el7                    @base  
[root@user1 ~]# yum list installed | grep python.x86_64
audit-libs-python.x86_64               2.7.6-3.el7                     @base    
dbus-python.x86_64                     1.1.1-9.el7                     installed
libselinux-python.x86_64               2.5-11.el7                      @base    
libsemanage-python.x86_64              2.5-8.el7                       @base    
libxml2-python.x86_64                  2.9.1-6.el7_2.3                 installed
newt-python.x86_64                     0.52.15-4.el7                   installed
policycoreutils-python.x86_64          2.5-17.1.el7                    @base    
python.x86_64                          2.7.5-58.el7                    @base    
rpm-python.x86_64                      4.11.3-25.el7                   @base   
yum list installed | grep python-2.7.5 不支持,需要使用特殊结构查询,这里不展开,可自行查询

rpm -qa 介绍

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

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

参考

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

你可能感兴趣的:(LInux,list,windows,python)