diff --git a/lib/package_remove.c b/lib/package_remove.c index be06b784..0c91f61d 100644 --- a/lib/package_remove.c +++ b/lib/package_remove.c @@ -180,11 +180,13 @@ xbps_remove_pkg(struct xbps_handle *xhp, pkgname = xbps_pkg_name(pkgver); assert(pkgname); - if ((rv = xbps_pkg_state_installed(xhp, pkgname, &state)) != 0) - goto out; + xbps_dbg_printf(xhp, "attempting to remove %s state %d\n", pkgver, state); - xbps_dbg_printf(xhp, "attempting to remove %s state %d\n", - pkgver, state); + if ((rv = xbps_pkg_state_installed(xhp, pkgname, &state)) != 0) { + xbps_dbg_printf(xhp, "cannot find %s in pkgdb: %s\n", + pkgver, strerror(rv)); + goto out; + } if (!update) xbps_set_cb_state(xhp, XBPS_STATE_REMOVE, 0, pkgver, NULL);