GNOME Bugzilla – Bug 628950
fails to install a list of packages if one of them is already installed
Last modified: 2014-08-06 14:29:40 UTC
(This is 2.30.x, but the code is still the same on git master.) Calling InstallPackageNames with a list of packages of length > 1, where one of the packages is already installed (but some others are NOT installed), fails with a "org.freedesktop.PackageKit.Modify.Failed: package already found" error. I'd have expected the operation to install the missing packages in the list, instead. I traced the problem to gnome-packagekit/src/gpk-dbus-task.c:gpk_dbus_task_install_package_names_resolve_cb(): /* see what we've got already */ for (i=0; i<array->len; i++) { item = g_ptr_array_index (array, i); g_object_get (item, "info", &info, "package-id", &package_id_tmp, NULL); if (info == PK_INFO_ENUM_INSTALLED) { already_installed = TRUE; } else if (info == PK_INFO_ENUM_AVAILABLE) { egg_debug ("package '%s' resolved", package_id_tmp); package_id = g_strdup (package_id_tmp); [BTW, this leaks the string copy if there's more than one package in this state.] //TODO: we need to list these in a gpk-dbus_task-chooser } g_free (package_id_tmp); } /* already installed? */ if (already_installed) { if (dtask->priv->show_warning) { /* TRANSLATORS: title: package is already installed */ gpk_modal_dialog_setup (dtask->priv->dialog, GPK_MODAL_DIALOG_PAGE_WARNING, 0); gpk_modal_dialog_set_title (dtask->priv->dialog, _("Failed to install packages")); /* TRANSLATORS: message: package is already installed */ gpk_modal_dialog_set_message (dtask->priv->dialog, _("The package is already installed")); gpk_modal_dialog_present (dtask->priv->dialog); gpk_modal_dialog_run (dtask->priv->dialog); } error_dbus = g_error_new (GPK_DBUS_ERROR, GPK_DBUS_ERROR_FAILED, "package already found"); gpk_dbus_task_dbus_return_error (dtask, error_dbus); g_error_free (error_dbus); goto out; } Instead of checking if ONE package is already installed, it should check if ALL requested packages are already installed.
I too find this problem in Fedora 18. PackageKit is not attempting the missing package to be installed. I have tested this with sample python example given in PackageKit docs.
I'm not spending much more developer time on gnome-packagekit, see gnome-software instead. If you can provide a patch I'll gladly merge it. Sorry.