How to check if the package is installed in linux

 Commands for check installed package :





With Apt command : 

List all installed packaged :
# apt list --installed

For check particular package :
# apt list --installed | grep -i apache


With DPKG Command 


List all installed package
# dpkg -l


List particular package name
# dpkg -l | grep apache2

-OR-

# dpkg -l | grep apahce2 | awk '{print $2, $3}'

the second version prints just the name and version of the package.
If the package is not installed nothing is printed to the terminal.




For Cent OS :

List all enabled repository on your system.
# yum list installed

List particular package with yum
# yum list installed | grep php


From RPM :
# rpm -qa | grep httpd





By Vishal Vyas

Comments

Popular posts from this blog

Another instance of Certbot is already running - Solved - Linux guru

Install Apache Using Ansible Playbooks

Setup password less SSH on linux

Create aws s3 bucket using cli

Secure nginx with Let's Encrypt on Ubuntu 18.04