Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PackageKit not automatically refreshing updates #588

Open
christiantosta opened this issue Nov 30, 2022 · 7 comments
Open

PackageKit not automatically refreshing updates #588

christiantosta opened this issue Nov 30, 2022 · 7 comments

Comments

@christiantosta
Copy link

I'm running Fedora 37 with KDE Discover, which uses the PackageKit infrastructure to get updates, and I came across the following problem: if I run a "dnf upgrade" the updates are shown normally, however they are not shown in Discover.

A bug was opened with KDE about this and it became evident that the problem is related to PackageKit or some plugin related to the distribution.

https://bugs.kde.org/show_bug.cgi?id=461962
discover-or-packagekit-bug

So, as sugested by Nate from KDE, I ran some pkcon commands (see attachments).

As you can see, it looks like PackageKit is not automatically updating the update lists.
pkcon-commands-output.txt

The packagekitd is running normally as root user.

@ximion
Copy link
Collaborator

ximion commented Nov 30, 2022

This is working perfectly fine on Debian/Ubuntu, so I wonder whether this is actually an issue with the DNF backend in PK - maybe DNF doesn't notify the daemon that there were changes to the cache?

@christiantosta
Copy link
Author

Please see #9 and Fedora bugzilla#1950041. Maybe is this related to that cache-age issues?

https://bugzilla.redhat.com/show_bug.cgi?id=1950041

PS: If I run pkcon with -c option, the cache refreshes and updates turns available to Discover.

@ximion
Copy link
Collaborator

ximion commented Nov 30, 2022

PS: If I run pkcon with -c option, the cache refreshes and updates turns available to Discover.

That's quite telling! This needs someone with DNF experience to resolve then...

@aleasto
Copy link
Contributor

aleasto commented Aug 28, 2023

The default maximum-cache-age in PackageKit is G_MAXUINT, which the dnf backend correctly interprets as 'always use the cache'.

Gnome-Software seems to be manually setting the cache age for its transactions, so this doesn't interest them.
Plasma-Discover instead uses the default, which if the default is G_MAXUINT should probably be changed to something sane instead.

The question is why does the apt backend act differently? I think the dnf backend is behaving correctly here.

@aleasto
Copy link
Contributor

aleasto commented Sep 2, 2023

So the apt backend ignores cache-age completely. Instead, it relies on manual RefreshCache() calls.

The dnf backend instead honours cache-age for all transactions - which is G_MAXUINT by default - including RefreshCache. That means that while for the apt backend it is enough to call RefreshCache(false /*force*/), to achieve the same thing you'd need to call RefreshCache(true /*force*/). The apt backend ignores the force parameter as without a cache-age every refresh is forced.
So fedora downstream "fixed" this issue with this patch, which I'm now considering adopting in upstream KDE

Overall I'm quite unhappy with how differently different backends behave...

@ximion
Copy link
Collaborator

ximion commented Sep 2, 2023

So the apt backend ignores cache-age completely. Instead, it relies on manual RefreshCache() calls.

The dnf backend instead honours cache-age for all transactions

Yes, that's just how APT is designed vs how DNF is designed. They just work differently in that regard, and PackageKit doesn't abstract this away.

@aleasto
Copy link
Contributor

aleasto commented Sep 2, 2023

I think it is an issue that RefreshCache() - analogously pkcon refresh - by default will never refresh the cache with the dnf backend.
Because the default cache-age is G_MAXUINT and the default force value is false.
It is implemented correctly (aka not a bug), but very unexpected if you just want to use packagekit without knowing the internals of all backends...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants