Description of problem: With a Fedora 19 guest, inspect-list-applications does not list all installed kernels. $ sudo guestfish --ro -a /dev/vg_data/F19Rawhidex64 -i Welcome to guestfish, the libguestfs filesystem interactive shell for editing virtual machine filesystems. Type: 'help' for help on commands 'man' to read the manual 'quit' to quit the shell Operating system: Fedora release 18 (Spherical Cow) /dev/mapper/vg_f18rawhidex64-lv_root mounted on / /dev/sda2 mounted on /boot ><fs> inspect-list-applications /dev/vg_f18rawhidex64/lv_root | cat > /tmp/apps The only kernel package in the returned list is: [426] = { app_name: kernel app_display_name: app_epoch: 0 app_version: 3.5.0 app_release: 0.rc4.git0.1.fc18 app_install_path: app_trans_path: app_publisher: app_url: app_source_package: app_summary: app_description: } However running 'rpm -q kernel' inside the machine shows other kernel packages are installed: $ rpm -q kernel kernel-3.5.0-0.rc4.git0.1.fc18.x86_64 kernel-3.6.0-0.rc2.git0.2.bz847548.fc18.x86_64 kernel-3.6.0-0.rc6.git0.2.fc18.x86_64 Version-Release number of selected component (if applicable): guestfish 1.19.43 on Fedora 18 host. How reproducible: 100% reliable.
In the guest: $ rpm -qa | wc -l 1394 The number of apps returned by libguestfs was 1358 (ie. 36 missing).
I laboriously wrote an emacs macro to translate the output of inspect-list-applications so it matches the output of rpm -qa (minus the %{arch} field which unfortunately we don't have in libguestfs). Most of the differences are because of extra arch packages. eg: audit-libs-2.2.1-2.fc18.i686 audit-libs-2.2.1-2.fc18.x86_64 is reported as a single instance by libguestfs: [47] = { app_name: audit-libs app_display_name: app_epoch: 0 app_version: 2.2.1 app_release: 2.fc18 app_install_path: app_trans_path: app_publisher: app_url: app_source_package: app_summary: app_description: } This is arguably a bug in libguestfs, so I filed it as a separate issue: bug 859949 The second issue is that RPM allows duplicate packages to be installed (same name, different version) and libguestfs does not show these. eg: kernel-3.5.0-0.rc4.git0.1.fc18 kernel-3.6.0-0.rc2.git0.2.bz847548.fc18 kernel-3.6.0-0.rc6.git0.2.fc18 is reported as a single package: [426] = { app_name: kernel app_display_name: app_epoch: 0 app_version: 3.5.0 app_release: 0.rc4.git0.1.fc18 app_install_path: app_trans_path: app_publisher: app_url: app_source_package: app_summary: app_description: } I don't know if it reports a particular version (eg. the smallest) or just reports one at random. These two issues account for all 36 "missing" packages. This bug relates to the second issue.
Fixed upstream in https://github.com/libguestfs/libguestfs/commit/63a091e21dbb509923eaeeb310707447385c566c