packagekit: Installed app can claim different source
Moving this from a downstream bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=2059312
When there are installed multiple PackageKit repositories, where each provides the same application, then the installed application can be claimed as being from the origin, which is not the one it is installed from.
An example is an Audacity application, which is provided by fedora
repository and by rpmfusion
repository. Even the package name is different, the app ID is the same. Steps to reproduce:
- enable
rpmfusion
on the machine and thefedora
withfedora-updates
- install
audacity
package from thefedora
repository (sudo dnf install audacity --disablerepo=rpmfusion-free-updates --disablerepo=rpmfusion-free
) - open the Software and switch to the Installed page
- click on the Audacity application to see its details
Actual result
The rpmfusion
Source is selected, with the fedora
Source missing. Trying to uninstall the application leads to an error: "Unable to remove Audacity: no packages to remove".
Expected
As the app was installed from the fedora
repository, the Software should show the application as such, instead of providing the repository with the latest version.
Notes
- the packagekit plugin doesn't provide list of installed applications, it's left on the appstream plugin; even it knows both origins, it picks the rpmfusion, probably due to it providing the latest version
- it makes perfect sense to show only one (PackageKit) repository in the Sources when the application is to be installed, instead of showing outdated versions from other (PackageKit) repositories (like when the
fedora
repository contains a base version andfedora-updates
updated version), but not that much when it's about already installed apps
The output from pkcon search audacity
:
Installed audacity-3.0.2-5.fc35.x86_64 (installed:fedora) Multitrack audio editor
Available audacity-freeworld-3.1.3-1.fc35.x86_64 (rpmfusion-free-updates) Multitrack audio editor
Unavailable audacity-freeworld-3.0.5-2.fc35.x86_64 (rpmfusion-free) Multitrack audio editor
Available audacity-manual-3.0.2-5.fc35.noarch (fedora) Manual for Audacity - Offline Install
Thus the packagekit itself does know from where the app comes, it's the appstream plugin matching in a bad way.
I do not know how to deal with this right now. Maybe implement list_installed_apps
on the PackageKit side?