Pkexec only works from terminal

Ubuntu Support Template

Ubuntu Version:
25.10

Desktop Environment (if applicable):
XFCE

Problem Description

I did a fresh install of Xubuntu 25.10. Ran Synaptic from the menu (executed command is

“pkexec /usr/sbin/synaptic”).

Installed deja-dup. Restored my home directory from a backup of another installation of Xubuntu 25.10. Logged out and back in. Ran Synaptic from the menu. Nothing happened.

Running “pkexec /usr/sbin/synaptic“ in a terminal prompts for the password in the terminal and allows the application to run. Checking the “Run in terminal” box in the launcher allows the application to run. This is not nice, but I could live with it.

However, the App Center now cannot install or update software. I get a message box with the title “Something went wrong” and the text “We’re sorry, but we’re not sure what the error is.” This means some software will not be upgraded, which is not OK.

So it seems that adding or overwriting a file in my home directory causes pkexec to misbehave. Nothing that I have been able to find about pkexec indicates that it uses any files in my home directory.

What I’ve Tried:

Changing the command to

“pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY /usr/sbin/synaptic”

has no effect and would not affect the App Center problem anyway.

I have done this twice with the same results, though I doubt that others can reproduce it. The second time, after restoring the backup, I tried running Synaptic from the menu before logging out, and it worked OK. So only after restoring the backup, logging out, and then logging in does the problem appear.

1 Like

Hey! I’m not 100% sure on this, but your symptoms sound like they could be the polkit authentication agent not starting correctly after you restore your home directory — that’s the component that handles GUI password prompts for things like Synaptic and the App Center.

Before we go too far down any rabbit holes, can you run this after logging in and let us know what comes back?

bash

pgrep -a polkit; pgrep -a xfce-polkit; pgrep -a lxpolkit

If those come back empty, that might be the core of the problem. If something shows up, paste the output and we can go from there. Hopefully someone with more specific knowledge will chime in too!

1 Like

That gives

1501 /usr/lib/polkit-1/polkitd --no-debug --log-level=notice

Looking at my “Session and Startup” “Application Autostart”, I see that “PolicyKit Authentication Agent (PolicyKit Authentication Agent for the MATE desktop)” is unchecked, and “PolicyKit Authentication Agent (PolicyKit Authentication Agent)” is checked.

Hey, good to know polkitd is running — that’s the backend side of things. The issue is there’s nothing showing up as the frontend agent, which is the part that actually pops up the GUI password dialog when something like Synaptic or the App Center needs elevated permissions.

Since the PolicyKit Authentication Agent is checked in your startup settings but isn’t showing up as a running process, it would be really helpful to see what command it’s actually trying to run. It’s possible the restore brought over a path that’s changed or doesn’t exist on 25.10.

Can you run this and paste the output?

bash

grep -r "Exec" ~/.config/autostart/ | grep -i polkit

If that folder doesn’t exist or comes back empty, try this one instead:

bash

grep -i "Exec" /etc/xdg/autostart/*polkit*

That’ll tell us exactly what file the system is trying to launch so we can check if it actually exists!

That gives

/home/jrcarter/.config/autostart/polkit-gnome-authentication-agent-1.desktop:Exec=polkit-gnome-authentication-agent-1

The directory /usr/lib/policykit-1-gnome/ doesn’t exist.

This gives

Exec=/usr/libexec/polkit-mate-authentication-agent-1

which appears to come from /etc/xdg/autostart/polkit-mate-authentication-agent-1.desktop. /usr/libexec/polkit-mate-authentication-agent-1 does exist.

That’s really helpful, I think we may have found something worth testing! Your restored home directory brought back an old autostart entry that’s trying to launch polkit-gnome-authentication-agent-1 but that doesn’t exist on this install. The system level entry points to the MATE polkit agent which does exist, but your user level entry may be taking priority with a broken path.

Let’s work through this step by step to test the theory:

Step 1 — Check if the MATE polkit agent is installed:

bash

dpkg -l | grep -i mate-polkit
  • If you see a line starting with ii then it’s installed, move to Step 2

  • If you see nothing, install it with:

bash

sudo apt install mate-polkit

Step 2 — Verify the binary exists:

bash

ls -la /usr/libexec/polkit-mate-authentication-agent-1
  • If the file is listed, move to Step 3

  • If you get “No such file or directory”, let us know and we’ll dig further

Step 3 — Move the broken autostart entry out of the way:

Rather than deleting it we’ll just rename it as a backup in case anything goes wrong:

bash

mv ~/.config/autostart/polkit-gnome-authentication-agent-1.desktop ~/.config/autostart/polkit-gnome-authentication-agent-1.desktop.bak

Step 4 — Log out and back in then test:

  • Try launching Synaptic from the menu

  • Try installing or updating something in the App Center

If anything goes wrong and you need to restore the old file:

bash

mv ~/.config/autostart/polkit-gnome-authentication-agent-1.desktop.bak ~/.config/autostart/polkit-gnome-authentication-agent-1.desktop
1 Like

Before I received your latest message, I tried checking “PolicyKit Authentication Agent (PolicyKit Authentication Agent for the MATE desktop)” in the Application Autostart list. Logging out and back in showed that that fixed the problem. Thanks very much for your assistance.

Not a problem at all. Hope you have a wonderful rest of your day!

This topic was automatically closed 18 hours after the last reply. New replies are no longer allowed.