0

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?

dan
  • 103

1 Answers1

2

To summarize, zypper is much more verbose than rpm. Just to show the difference on one example on one of my VMs:

ses7-host1:~ # zypper se -si ceph-common
Loading repository data...
Reading installed packages...

S | Name | Type | Version | Arch | Repository ---+---------------------+---------+--------------------------------+--------+------------------------------------------------- i+ | ceph-common | package | 15.2.14.84+gb6e5642e260-3.31.1 | x86_64 | SLE-Module-Basesystem15-SP2-Updates for x86_64 i+ | ceph-common | package | 15.2.14.84+gb6e5642e260-3.31.1 | x86_64 | SUSE-Enterprise-Storage-7-Updates for x86_64 SP2 i | python3-ceph-common | package | 15.2.14.84+gb6e5642e260-3.31.1 | x86_64 | SLE-Module-Basesystem15-SP2-Updates for x86_64 i | python3-ceph-common | package | 15.2.14.84+gb6e5642e260-3.31.1 | x86_64 | SUSE-Enterprise-Storage-7-Updates for x86_64 SP2

The package ceph-common is available from two different repositories, but is listed as installed from both since the versions are exactly the same. But rpm can only intall one package, of course:

ses7-host1:~ # rpm -qa | grep ceph-common
ceph-common-15.2.14.84+gb6e5642e260-3.31.1.x86_64
python3-ceph-common-15.2.14.84+gb6e5642e260-3.31.1.x86_64

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 of rpm -qa is a subset of zypper se -si.

eblock
  • 577
  • 1
  • 3
  • 6