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
查出结果如上分三列显示,可以针对单独某列进行查询,比如文章来源:https://www.toymoban.com/news/detail-822293.html
[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://www.toymoban.com/news/detail-822293.html
到了这里,关于“rpm -qa“ 和 “yum list installed“ 的区别的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!