Removing software; blowing your feet off

In packagekit, there are two modes for removing a package, force-true and force-false. If force is false, then the package will only be removed if no other packages depend on it. If force is true, then it and any packages that depend on it are also removed.

With this power allows us to do cool things, but also give us the chance to blow our feet off. Just try removing glibc with force-true. Fun times.

In pkcon (text mode program) and pk-application (GUI add/remove tool) we could only do force-false until recently to avoid foot injuries. Matej pointed out removing gimp leads to a chain of deps that couldn't be removed in this way.

I've now added the following dialog into the GUI tool, I'll do the same with the console program too. Internally it just calls GetRequires on the package before calling RemovePackage, and prompts if the requires packagelist size is non-zero.

This gives us a nice way to do this in a backend abstracted way, and should stop anyone removing stuff like HAL without agreeing to remove a lot of other packages.

HIG compliance is rubbish, I'm crap at that sort of thing. If anyone has any suggestions to make it HIG compliant, yell and I'll see what I can do. If anyone is feeling really cool, the new dialog is created in src/pk-application.c:pk_application_requires_finished_cb() – patches welcomed with glee. That is all.

Published by


Richard has over 10 years of experience developing open source software. He is the maintainer of GNOME Software, PackageKit, GNOME Packagekit, GNOME Power Manager, GNOME Color Manager, colord, and UPower and also contributes to many other projects and opensource standards. Richard has three main areas of interest on the free desktop, color management, package management, and power management. Richard graduated a few years ago from the University of Surrey with a Masters in Electronics Engineering. He now works for Red Hat in the desktop group, and also manages a company selling open source calibration equipment. Richard's outside interests include taking photos and eating good food.

One thought on “Removing software; blowing your feet off”

  1. There is a nice feature in Debian-based packaging where packages are listed with an importance. If you try to remove a package that you really need, e.g. libc it makes you type “YES, I'M SURE I WANT TO DO THIS” on the console. People will just click through a dialog like the one you've shown without reading it, so perhaps you need a second dialog where appropriate. Something like:

    ——————————————- | Really remove critical software? | | | | Removing the following software is | | likely to make your system unusable: | | – libc6 | | Check the box to continue, if you're | | absolutely sure you want to do this. | | | | [ ] Yes, I really know what I'm doing | | | | [Cancel] [Continue] | | | ——————————————-

Comments are closed.