Differences between "rpm -ql" and "dnf repoquery -l"

One.

dnf list installed  btrfs-progs 
Installed Packages
btrfs-progs.x86_64                                               6.6.2-1.fc39                                               @updates

Two

$ rpm -ql btrfs-progs |grep bin
/usr/sbin/btrfs
/usr/sbin/btrfs-convert
/usr/sbin/btrfs-find-root
/usr/sbin/btrfs-image
/usr/sbin/btrfs-map-logical
/usr/sbin/btrfs-select-super
/usr/sbin/btrfsck
/usr/sbin/btrfstune
/usr/sbin/fsck.btrfs
/usr/sbin/mkfs.btrfs

Tree

$ sudo dnf repoquery -l btrfs-progs |grep bin|sort
Last metadata expiration check: 0:59:15 ago on Sun Nov 26 13:41:26 2023./usr/sbin/btrfs
/usr/sbin/btrfs
/usr/sbin/btrfs
/usr/sbin/btrfsck
/usr/sbin/btrfsck
/usr/sbin/btrfsck
/usr/sbin/btrfs-convert
/usr/sbin/btrfs-convert
/usr/sbin/btrfs-convert
/usr/sbin/btrfs-find-root
/usr/sbin/btrfs-find-root
/usr/sbin/btrfs-find-root
/usr/sbin/btrfs-image
/usr/sbin/btrfs-image
/usr/sbin/btrfs-image
---8<---

Q=
Why is each line tripled?

dnf repoquery shows what is in the repositories, and rpm -q shows you what you have installed.

If a package is available in fedora, updates, and updates-testing in different versions, then repoquery will display all files from all versions of the package, thus 3 times.

1 Like

How to make dnf repoquery to show installed version only?

Use rpm to inquire about installed packages.

sudo dnf repoquery --installed -l btrfs-progs |grep bin| sort

1 Like