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

发布时间:2024年01月10日

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 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.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?

文章来源:https://blog.csdn.net/weixin_37646636/article/details/135508845
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。