YouTube Icon

Code Playground.

How to List Installed Packages on CentOS

CFG

How to List Installed Packages on CentOS

In this instructional exercise, we will tell you the best way to rundown and channel introduced bundles on CentOS. Realizing how to list introduced bundles on your CentOS framework can be useful in circumstances where you have to introduce similar bundles on another machine or in the event that you need to re-introduce your framework. 

We will likewise tell you the best way to check whether a particular bundle is introduced, tally introduced bundles, and discover the form of an introduced bundle. 

List Installed Packages with Yum

YUM (Yellow canine Updater,) is the default CentOS bundle supervisor. It very well may be utilized to download, introduce, eliminate, question, and overseeing CentOS RPM programming bundles from the official and outsider CentOS stores. 

To list the introduced bundles on your CentOS framework with yum, utilize the accompanying order: 

sudo yum list installed

It will print a rundown of all introduced bundles, including data about the variants and store of the RPM bundles. 

 Typically, the bundles list is long, for better intelligibility it is a smart thought to pipe the yield to less: 

sudo yum list installed | less

To see if a particular bundle is introduced, channel the yield with the grep order. 

For instance, to see whether the unfasten bundle is introduced on the framework you would run: 

sudo yum list installed | grep unzip
unzip.x86_64    6.0-19.el7    @anaconda

The yield above shows that unfasten form 6.0-19 is introduced on the machine. 

List Installed Packages with Rpm

The rpm order with the - q choice permits you to question the bundles. 

The accompanying order will rundown of all introduced bundles: 

sudo rpm -qa

To inquiry (search) regardless of whether a specific bundle is introduced pass the bundle name to the rpm - q order. The accompanying order will show you whether the tmux bundle is introduced on the framework: 

sudo rpm -q tmux

On the off chance that the bundle is introduced, you will see something like this: 

tmux-1.8-4.el7.x86_64

Something else, the order will print: 

package tmux2is not installed

To get more data about the questioned bundle pass - I: 

sudo rpm -qi tmux

Create a List of all Installed packages

To make a rundown of the names of all introduced bundles on your CentOS framework and spare it in a document named packages_list.txt, divert the order yield to the record: 

sudo rpm -qa > packages_list.txt

To introduce similar bundles on another worker you can utilize the feline order to pass all bundles to yum: 

sudo yum -y install $(cat packages_list.txt)

Count the number of installed packages

To discover the number of bundles are introduced on your framework, utilize a similar order as in the past yet as opposed to diverting the yield to a document, pipe it to the wc utility to tally the lines: 

sudo rpm -qa | wc -l
603

The yield above shows that there are 603 bundles introduced. 

Conclusion

In CentOS frameworks you can list introduced bundles utilizing the yum list introduced and rpm - qa orders. 

Don't hesitate to leave a remark on the off chance that you have any inquiries.




CFG