Codecs and PackageKit in GNOME Software on Ubuntu Artful

Iain Lane
2 min readJun 30, 2017

--

There are some changes coming soon™ to software installation via GNOME Software in Artful.

PackageKit

PackageKit is a distribution-agnostic API for managing installed software packages on a system. For irritating reasons, Ubuntu was stuck for a long time on an old version of PackageKit, but we recently managed to remove the blockers and update to a modern version.

For me, a really positive thing to come out of this is that we are able to remove our Ubuntu specific apt plugin inside GNOME Software. This plugin uses both libapt and aptdaemon to manage package listing, installation, updating and removal. We had to write all this code, it isn’t in the upstream package, and it has been the source of bugs in the past — bugs which wouldn’t have happened if we had been able to use PackageKit. Once this work is all uploaded to Ubuntu, we’ll be sharing the same plugin as most other distributions, meaning that we all benefit from everybody’s fixes.

Installing codecs

That’s all more or less invisible to users though — given that we’ve worked hard to fix many known bugs in the apt plugin.

Let’s talk about something else that’s possible now that we’re using the new PackageKit.

In Ubuntu currently, when you try to play an audio or video file for which you don’t have a codec, the experience looks like this.

Installing a codec on Ubuntu 16.04 via sessioninstaller

The software that’s providing this procedure is called sessioninstaller. It’s a piece of software that provides PackageKit’s “session” interface, used by applications to request the installation of software such as codecs. Behind the scenes it doesn’t use PackageKit at all to install software — this is handled by aptdaemon. While this solution has worked well for Ubuntu for a long while, the sessioninstaller package (along with aptdaemon itself) is more or less unmaintained and we would like to centralise software installation and management in GNOME Software. Enabling the PackageKit backend allows GNOME Software to provide the session interface itself — it performs the same job that sessioninstaller does but inside the same program that we use for other software installation. It now looks like this.

Installing a codec on Ubuntu Artful via GNOME Software

This work is not in Ubuntu yet, but it will be before the Alpha 2 release of Artful. You can try it from this PPA, if you’re adventurous. To get to this stage, fixes were required in many components. The AppStream generator needed to be enhanced to provide decent metadata about the packages containing codecs. Some bugs in GNOME Software itself were discovered, which prevented the results for showing properly. And PackageKit itself needed fixes in its aptcc backend. Some of these are already upstream, and some are proposed. I don’t think any of the work we’ve done here is Ubuntu specific. These enhancements should benefit Debian users too, once the releases are uploaded there.

It’s been fun closing some of the gaps between Ubuntu and upstream. I hope we can continue to walk this path and improve the software management experiences further.

--

--