How can I fix the issue where Add/Remove Software never asks for my password?

5,834

I guess you are using Gnome? Anyway, use the tools provided by whichever GUI you are using and make sure that the menu item that you use to launch your package manager points to (I believe the package manager in CentOS is called pirut but change accordingly):

gksudo pirut

and not just pirut. That should make it ask you for a password next time.

Share:
5,834

Related videos on Youtube

Hugo
Author by

Hugo

Updated on September 18, 2022

Comments

  • Hugo
    Hugo almost 2 years

    Using CentOS Release 6.4 x86 when I go to System > Administration > Add/Remove Software and try to add software or refresh the package list, I immediately get the following error:

    Authorization Failed

    Authorization Failed

    You have failed to provide correct authentication. Please check any passwords or account settings.

    Failed to obtain authentication

    However the reason I failed to provide authentication is because I was never asked for a password at all. I'm running as a normal user who is a member of the wheel group and can run commands via sudo. I also can su to root. I am able to install software via yum.

    How can I fix the issue where Add/Remove Software never asks for a password?


    UPDATE: The issue appears to be with PolicyKit. Specifically, I have no authentication agent running and trying to start it results in the error

    Unable to determine the session we are in: Remote Exception invoking org.freedesktop.ConsoleKit.Manager.GetSessionForUnixProcess()

    Some terminal output:

    [jnet@dogYears Desktop]$ pkexec echo "test"
    Error executing command as another user: No authentication agent was found.
    
    [jnet@dogYears Desktop]$ ps awwwx|grep polkit        
     2059 ?        S      0:00 /usr/libexec/polkit-1/polkitd
    28688 pts/3    S+     0:00 grep polkit
    
    [jnet@dogYears Desktop]$ /usr/libexec/polkit-gnome-authentication-agent-1
    (polkit-gnome-authentication-agent-1:28725): polkit-gnome-1-WARNING **: Unable to determine the session we are in: Remote Exception invoking org.freedesktop.ConsoleKit.Manager.GetSessionForUnixProcess() on /org/freedesktop/ConsoleKit/Manager at name org.freedesktop.ConsoleKit: org.freedesktop.ConsoleKit.Manager.GeneralError: Unable to lookup session information for process '28725' org.freedesktop.ConsoleKit.Manager.GeneralError Unable%20to%20lookup%20session%20information%20for%20process%20%2728725%27
    
    • Admin
      Admin over 9 years
      I came here with the same problem. I am using VNC to connect into the host, no direct access (this might cause the problem)? Anyway, since I did not find a way to make the Gnome->Software Update work, I used yum. I just saw you also suggest this. :)
  • user2914606
    user2914606 over 10 years
    I think you're supposed to use gksudo instead, although I can't remember why. I'm also fairly sure you should use pkexec, if possible. that doesn't work with everything, though.
  • terdon
    terdon over 10 years
    @strugee never heard of pkexec is it a Red Hat thing? As for gksudo on my Debian it's just a link to gksu.
  • user2914606
    user2914606 over 10 years
    when invoked as gksudo it behaves differently, like e.g. bzip and bunzip. pkexec is a frontend to PolicyKit; for reference, Ubuntu had just dropped gksu in favor of pkexec when I abandoned ship for Arch (just under a year ago).
  • Hugo
    Hugo over 10 years
    Hm, I don't have gksu installed, so that's likely what's failing. I do have pkexec installed... when I run it, I get Error executing command as another user: No authentication agent was found.
  • terdon
    terdon over 10 years
    @Josh strange, it should have come with Gnome. Do you have gksudo? Sounds like pkexec needs some configuring but I've never used it so I can't help. I assume sudo pirut works as expected?
  • terdon
    terdon over 10 years
    @strugee as far as I know and as far as I can tell from the man page, calling gksudo uses sudo as the backend while gksu will use su. So, yes, you're right and gksudo is probably better. Thanks.
  • terdon
    terdon over 10 years
    @Josh some pointers here.