I'm looking at a reliable way to find how many installed packages I have on my OpenSUSE Leap 15.3 system. I tried:
# number of available packages in the repos
vm-admin:~ # zypper se -s | wc -l
55800
# number of installed packages from the repos
vm-admin:~ # zypper se -si | wc -l
1490
# number of installed packages?
vm-admin:~ # rpm -qa | wc -l
1091
# number of available packages?
vm-admin:~ # pkcon get-packages | grep Available | wc -l
51058
# number of installed packages?
vm-admin:~ # pkcon get-packages | grep Installed | wc -l
1086
What's the difference between these commands commands?
To summarize, zypper is much more verbose than rpm. Just to show the difference on one example on one of my VMs:
The package
ceph-common
is available from two different repositories, but is listed as installed from both since the versions are exactly the same. Butrpm
can only intall one package, of course:Then you also should have noticed that with
zypper se -si
you see more than just installed packages but also schemas, patches and patterns, maybe even sources if you want to compile packages yourself. The output ofrpm -qa
is a subset ofzypper se -si
.