Development/Tutorials/PackageKit Session Interface

From KDE TechBase
Revision as of 03:57, 23 November 2010 by Dantti (talk | contribs) (Created page with '== What is PackageKit == PackageKit is an abstraction layer for basic package managing. Whether by basic it means providing what non technical users really need (searching/inst...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

What is PackageKit

PackageKit is an abstraction layer for basic package managing. Whether by basic it means providing what non technical users really need (searching/installing/removing/updating...). I is not intended to replace your package management, but to provide a single way of doing things. It's API is exported through a DBus interface, having glib, qt and python bindings. PolicyKit is also used so that you have a fine grained policy for your users.

This project is held by the free desktop umbrella, and has backends for several package managers (http://www.packagekit.org/pk-matrix.html). But although this API is abstracts enough the package manager it is still too complex for applications that just want fonts, drivers, plugins etc.

What is PackageKit Session Interface

PackageKit Session Interface is the interface to be used by applications that don't want to know how package managing is done. They will care only about on checking if a package is installed or installing packages.

This topic raised a lot of discussions on KDE mailing lists, because random applications can ask users to install softwares. In the end this interface does not allow you to install random software, since it can only install things from your repositories. I will not enter in the merit of this discussion, since it's pointless as some like this approach and others do not.

If you don't like you can just disable it on your distribution, if you like use it :D

And it is available from the two GUI KPackageKit (Apper) and GNOME-PackageKit.

What this Tutorial is about then

Well as the title says PackageKit Session Interface, I'll cover the API details so that you can make your application use it.

DBus has basically two connections types the Session and the System. System interfaces normally run as root (otherwise they need rights to use it), on the other hand the session connections runs on the user session. These two connections do not talk to each other.

As your application will be running as user (otherwise you could just install it yourself :P), then we export this interface on the user session. Also there is no binding to this API, it's just exposed on the bus in the examples I will be using QtDBus but you can use perl, python...