[packagekit] how to wake up packagekit after idle time

Matthias Klumpp matthias at tenstral.net
Thu Jul 26 11:29:00 PDT 2012


Hi!
You can use pure DBus calls to PackageKit, it is just not very comfortable...
The PackageKit daemon gets automatically activated (via
DBus-activation) if you issue a call on the system-bus and terminates
when there's no job to do.
I'd suggest you using libpackagekit-glib2, it is installed anyway and
much easier to use that doing calls on the system bus, but you can of
course to that if you want. (See the docs[1])
The code above uses the session bus and needs support in the session,
so this won't work I guess.
Regards,
   Matthias

----
[1]: http://packagekit.org/gtk-doc/

2012/7/26 tomw <tomw at ubilix.com>:
> Thanks, that sounds like there is no way around using libpackagekit then
> (or the respective GI bindings). I assume using a pure DBus approach on
> System Bus would not work either, unless you leave packagekitd running
> with the --disable-timer option, right?
>
>
> On Do, 2012-07-26 at 19:18 +0200, Matthias Klumpp wrote:
>> Then connecting to the session bus will never work... Instead, you
>> want PkTask from PackageKit's GObject-repository:
>>
>> from gi.repository import PackageKitGlib as packagekit
>>
>> pktask = packagekit.Task()
>> pktask.set_locale(make_locale_string())
>>
>> res = pktask.install_packages(...)
>>
>> You'll also need to display progress and connect error callbacks
>> (depending if you use th sync interface or not)
>> Cheers,
>>    Matthias
>
>
>


More information about the PackageKit mailing list