Bug 502380

Summary: Update fails if new dependency needs to be installed
Product: [Applications] Discover Reporter: ms_a7b411d9cf2d73213449e4df23dd12b2f6dc7daf
Component: PackageKitAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal CC: aleixpol, john.kizer, nate
Priority: NOR    
Version First Reported In: 6.3.2   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: example error

Description ms_a7b411d9cf2d73213449e4df23dd12b2f6dc7daf 2025-04-03 21:35:06 UTC
Created attachment 179976 [details]
example error

SUMMARY

Discover fails to update the system if the update includes new dependencies.


STEPS TO REPRODUCE
1. Try to start an update from Discover after some package in the distros repo got replaced / new dependency got added


OBSERVED RESULT

Update does not start. See attachment for example error message.


EXPECTED RESULT

Updates should work.


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: Debian testing
KDE Plasma Version: 6.3.2
KDE Frameworks Version: 6.11.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION

This can be worked around by using GNOME Software (or running apt dist-upgrade) but ofc this is not user friendly on a KDE system. Discover should be able to handle such updates.
Comment 1 Aleix Pol 2025-04-03 23:37:36 UTC
Here apt is saying that there's unmet dependencies. So it's not just new dependencies. Furthermore, this is handled by PackageKit's apt backend, not sure we can do much from Discover...

What am I missing?
Comment 2 ms_a7b411d9cf2d73213449e4df23dd12b2f6dc7daf 2025-04-04 12:10:45 UTC
(In reply to Aleix Pol from comment #1)
> Here apt is saying that there's unmet dependencies. So it's not just new
> dependencies. Furthermore, this is handled by PackageKit's apt backend, not
> sure we can do much from Discover...
> 
> What am I missing?

In this example the package "libonnxruntime1.20.1" got replaced by "libonnxruntime1.21".
So this update should:
- remove "libonnxruntime1.20.1"
- install "libonnxruntime1.21" with its dependencies

However Discover is not able to handle this transition and shows the error in the screenshot instead.

For comparison GNOME Software is able to update the system in this case.
Comment 3 Nate Graham 2025-04-04 12:18:18 UTC
Does GNOME Software still use PackageKit, or does it have some custom code to handle this?
Comment 4 John Kizer 2025-04-11 06:05:40 UTC
(In reply to Nate Graham from comment #3)
> Does GNOME Software still use PackageKit, or does it have some custom code
> to handle this?

I don't know if I've found the relevant stuff, but if I have then...both? :-)

https://gitlab.gnome.org/GNOME/gnome-software/-/issues/2232 and https://github.com/PackageKit/PackageKit/issues/642 together would seem to indicate that it's working there now because GNOME Software is specifically not asking PackageKit to upgrade a to-be-obsoleted package, which the APT backend is "technically correct" to refuse to do?

This note seems potentially relevant: https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/1737#note_1796261
Comment 5 ms_a7b411d9cf2d73213449e4df23dd12b2f6dc7daf 2025-04-15 15:51:05 UTC
(In reply to John Kizer from comment #4)

> https://gitlab.gnome.org/GNOME/gnome-software/-/issues/2232 and
> https://github.com/PackageKit/PackageKit/issues/642 together would seem to
> indicate that it's working there now because GNOME Software is specifically
> not asking PackageKit to upgrade a to-be-obsoleted package, which the APT
> backend is "technically correct" to refuse to do?
> 
> This note seems potentially relevant:
> https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/
> 1737#note_1796261

Nice find!
Looks like this could be the issue since I got the error in a similar situation (to-be-obsoleted package needs to be removed but I guess Discover tries to update it which won't work).