25 October 2016

Fixing PackageKit authentication in Debian sid under Xfce

Today after updating stuff, my pkexec commands (e.g., synaptic-pkexec) stopped working. I don't know whether this was caused by something I inadvertently did that borked things or whether it's a bug in Debian sid. I figured out that the root of the problem (no pun intended) is that a policy authentication agent was no longer loading on login -- in spite of policykit-1-gnome being installed and the entry for PolicyKit Authentication agent being checked in Xfce's Session and Startup autostarts.

Reinstalling stuff didn't help.

Further sleuthing revealed that the PolicyKit Authentication agent entry in Xfce's Session and Startup was pointing to a (now) nonexistent file: /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1. Further examination revealed that the file /etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop installed by policykit-1-gnome also was pointing to the same nonexistent file.

So here's what I did to kludge a fix:
  • Created a new directory /usr/lib/policykit-1-gnome
  • Added a link from /usr/lib/x86_64-linux-gnu/polkit-gnome-authentication-agent-1 to /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1.
After logging out and back in, things worked as expected.

I could have added a custom entry into my Xfce autostarts that pointed to the correct file, but that wouldn't have addressed the second issue of /etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop pointing to phantoms.

To undo the changes once/if the problem is better sorted, all I need to do is delete /usr/lib/policykit-1-gnome.