[packagekit] Problem running example from FAQ

Richard Hughes hughsient at gmail.com
Thu Aug 7 02:34:25 PDT 2008

On Wed, 2008-08-06 at 18:53 -0700, Dorian Perkins wrote:
> Hello again,
> So I have another question now. In reference to the example at hand,
> the FAQ mentions:
>       * InstallPackageName("openoffice-clipart")
>       * InstallProvideFile("/usr/share/fonts/sarai/Sarai_07.ttf")
>       * InstallLocalFile("/home/dave/Desktop/lirc-0.6.6-4.rhfc1.dag.i686.rpm")
>       * InstallMimeType("application/x-rpm")
>       * InstallFont("lang(en_GB)")
> "
> However, I'd like to do other tasks such as EnableRepo() and
> GetRepoList(), etc. How can I do this? Am I approaching this the wrong
> way?

Well, the problem is that you are using the session "easy" interface.
See http://www.packagekit.org/pk-faq.html#session-system for an
explanation of why you would want to use the session interface in an
trivial application, but the system one for more complex or for
integrated use cases.

To do RepoEnable you'll need to use the system service -- it's more
complicated but much more powerful. Luckily there are some nice GObject
bindings that make it a lot easier to work with. Have a look at an
example file I just uploaded: http://www.packagekit.org/files/system.c
-- all the docs for that are here: http://www.packagekit.org/gtk-doc/

That's certainly some reading for you to do! :-)


More information about the PackageKit mailing list