各种软件安装方式查询是否安装某软件包
一 、rpm安装的: rpm -qa | grep '软件或软件包名' (Oracle Linux属于Redhat系统的Linux)
[root@VM-0-5-centos ~]# rpm -qa | grep 'mysql'
[root@VM-0-5-centos ~]#
二、deb安装的:dpkg -l | grep '软件或软件包名' (.deb软件包是Debian系统Linux的软件包)
我的linux环境不支持此命令,示例仅做参考,可以在Ubuntu中尝试此写法
[root@VM-0-5-centos ~]# dpkg -l | grep 'mysql'
-bash: dpkg: command not found
[root@VM-0-5-centos ~]#
三、yum安装的: yum list installed | grep '软件或软件包名'
[root@VM-0-5-centos ~]# yum list installed | grep 'mysql'
[root@VM-0-5-centos ~]# yum list installed | grep 'gcc'
gcc.x86_64 4.8.5-39.el7 @os
libgcc.x86_64 4.8.5-39.