Ubuntu 18.04: No polkit authentication agent found

7,546

I met up with the same problem recently. I'm a newbie, so I don't know whether this can solve your problem, but here is my solution.

  1. find out which desktop environment I'm using

    ps -A | egrep -i "gnome|kde|mate|cinnamon|lx|xfce|jwm"
    
  2. search for the corresponding policykit package and install it.

    sudo apt search policykit
    sudo apt install policykit-1-gnome
    

    my desktop environment is GNOME

  3. (I don't know whether this step is necessary)

    exec /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
    

and then my problem had gone.

Share:
7,546

Related videos on Youtube

user3496020
Author by

user3496020

Updated on September 18, 2022

Comments

  • user3496020
    user3496020 over 1 year

    I get the error message above when I try to write to a file I don't have permission to in Visual Studio Code. I choose "Retry as sudo": Click sudo and get the error: Error message

    This only happens when I connect to the machine from my PC using ssh and X11-forwarding. Not when I run from gnome directly on Ubuntu machine.

    Help appreciated.

    Output from "systemctl status polkit.service"  
    
    Sep 02 20:03:19 rolf-PE-860 systemd[1]: Starting Authorization Manager...
    Sep 02 20:03:19 rolf-PE-860 systemd[1]: Started Authorization Manager.
    Sep 02 20:03:19 rolf-PE-860 polkitd[4155]: started daemon version 0.105 using authority implementation `local' version `0.105'
    Sep 02 20:03:19 rolf-PE-860 polkitd(authority=local)[4155]: Registered Authentication Agent for unix-session:14 (system bus name :1.80 [/usr/bin/gnome-shell], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
    Sep 02 20:03:19 rolf-PE-860 polkitd(authority=local)[4155]: Registered Authentication Agent for unix-session:c2 (system bus name :1.40 [/usr/bin/gnome-shell], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
    Sep 02 20:03:45 rolf-PE-860 polkitd(authority=local)[4155]: Registered Authentication Agent for unix-process:4160:201286 (system bus name :1.124 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
    Sep 02 20:03:51 rolf-PE-860 polkitd(authority=local)[4155]: Operator of unix-process:4160:201286 successfully authenticated as unix-user:rolf to gain ONE-SHOT authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.125 [systemctl start polkit.service] (owned by unix-user:rolf)
    Sep 02 20:03:51 rolf-PE-860 polkitd(authority=local)[4155]: Unregistered Authentication Agent for unix-process:4160:201286 (system bus name :1.124, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
    
  • damadam
    damadam over 4 years
    Can you add the source link of this solution (because it's sure that it's ot from you)?
  • John Smith
    John Smith almost 4 years
    Doesn't fix the problem (SE is batting .1000 on non-working solutions for Ubuntu, it seems.) I'm having this issue and the right policykit is already installed. The last step just returns an error.
  • ATorras
    ATorras about 3 years
    3rd step is necessary if no Gnome shell interaction is done (i.e. ssh)
  • balu
    balu almost 3 years
    This did the trick for me! I'm using a custom desktop environment, so I had to install policykit-1-gnome manually. Once I started it (step 3), everything worked as expected!