liang lei liang lei - 1 year ago 63
Linux Question

Yum and RPM show that the number of installed packages is different

[root@study ~]# rpm -qa | wc -l

[root@study ~]# yum list installed | wc -l

i want to know why different,shoud i get correct number of installed packages?

Answer Source

Example, CentOS 7 :

$ rpm -qa | wc -l

$ yum list installed | wc -l

Reason : wc will also count the 24 "extra yum lines" ... please check with :

$ yum list installed >> yum-list-installed.txt

$ rpm -qa >> list__rpm-qa.txt

... and watch the result in the text files : Use an editor with line numbers enabled.

Note : The above commands are unprivileged user commands. No reason to use root.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download