The installed-packages pipeline, refined, and its Red Hat equivalent
The installed-packages pipeline, refined, and its Red Hat equivalent
Answer
dpkg -l | grep -i python dpkg -l | grep -i '^ii.*python' rpm -qa | grep -i python
The pipe makes grep filter dpkg standard output. -i is not optional here: package names appear as python3-, libpython and Python. The middle line also drops removed-but-not-purged entries by anchoring on the ii status column. dpkg is Debian-family only.
Sarwar & Koretsky 3e ch7 §7.6