How to check what packages are installed in centos 7

Опубликовано: 15 Март 2021
на канале: ErrorAndFix
1,956
13

How to check and list installed packages in CentOS Linux
How do I check installed packages in CentOS Linux version 6.x/7.x/8.x? How can I List installed packages on CentOS Enterprise Linux server?
This page shows you how to check and list all installed packages in CentOS Linux server version 6.x/7.x/8.x using various command-line utilities. Such a list is useful in case if you need to restore/reinstall or mirror the same packages across different CentOS servers.

** How to check installed packages in CentOS:
The procedure is as follows to list installed packages:

1. Open the terminal app.
2. For remote server log in using the ssh command:
$ ssh user@centos-linux-server-IP-here
3. Show information about all installed packages on CentOS, run:
$ sudo yum list installed
$ sudo yum list installed | more

One can use the grep command as filter too. For example, find out if nginx installed or not:
$ sudo yum list installed | grep python3

Want to lists extras packages installed on the system that are not available in any known repository? Try:
$ yum list extras

Lists all packages known to use:
$ yum list all

Finally, show available packages, run:
$ yum list available

4. To count all installed packages run:
$ yum list installed | wc -l
$ yum list all | wc -l
$ yum list available | wc -l


How to check what packages are installed in centos 7

5. Want to save all installed packages names in a file? Try:
$ sudo yum list installed my_list.txt
6. Execute the command sudo yum update to refresh package database and install updates if any.
Display packages list that needs updates/patching
Keeping your CentOS box secure is an essential task. One can get a list of all upgrades available for the installed packages too. Type:
$ yum list upgrades
$ yum list upgrades | more
$ yum list upgrades | grep -i kernel

*** Get a list of all installed packages with rpm command
sudo rpm -qa
sudo rpm -qa | more
sudo rpm -qa | wc -l
sudo rpm -qa | grep bash
Is nginx and bash package installed? Find out, run:
rpm -q nginx
package nginx is not installed
rpm -q bash
bash-4.2.46-29.el7_4.x86_64


*** How to check for installed packages on CentOS and backup them
How to check for installed packages on CentOS and backup them
$ rpm -qa --qf "%{NAME}\n" |sort /root/installed-software-mm-dd-yyyy.log
To restore all those packages when needed, run:
$ yum -y install $(cat /root/installed-software-mm-dd-yyyy.log)

⭐ Connecting With Us ⭐
-------------------------------------------
Email for any enquiry: [email protected]
YouTube Channel:    / errorandfix  
Join our FB Group:   / errorandfix  
Like our FB Page:   / errorandfix  
Website: https://errorandfix.com
TikTok:   / hungdo9049