Ubuntu – Software center cannot install or remove software

software-center

I have Ubuntu 12.10 and when I try to install a new software using the software center, it fails with the following error message:

Authentication Error
Software cannot be installed or removed because the authentication service is not
available.(org.freedesktop.PolicyKit.Error.Failed:("system-bus-name",
{name:1.475}).org.debian.apt.install-or-remove-packages

This is a new problem that I did not have before! Any suggestions?

Best Answer

This instance of the problem might be caused by a bug; I recommend considering reporting this as a bug in PolicyKit.

However, this problem can occur with or without a bug, for example, as a consequence of manual PolicyKit configuration changes (or deinstallation). Therefore, it merits an answer here.

This is happening because the PolicyKit service is not running. Here's a couple ways to fix this:

Make sure the necessary PolicyKit packages are installed.

Open a Terminal (Ctrl+Alt+T) and run:

sudo apt-get update && sudo apt-get install policykit-1 policykit-1-gnome

Then reboot and see if the problem is fixed. (Logging out and back in might fix the problem too.)

Run the Software Center with gksu/gksudo instead of PolicyKit.

If that doesn't work, you can still run the Software Center by working around the problem. PolicyKit is one way an authorized user (typically an administrator) can perform actions as root in a typically configured Ubuntu system, but it is not the only way. sudo is the other.

For graphical programs, running them with sudo directly often will work (as in Thomas's answer). But it is not recommended, primarily because it can cause the non-root user's configuration files to become owned by root.

  • For graphical programs that don't store configuration files in a user's home directory, this doesn't matter. But most do, and the Software Center is no exception. (It uses ~/.config/software-center, where ~ is your home directory.)

So it's recommended to use a non-graphical frontend instead: gksu/gksudo, or (if you're running Kubuntu) kdesudo.

So, press Alt+F2 and run:

gksu software-center

Running gksu software-center in Unity.

(This works in all desktop environments, not just Unity, though of course it looks different in others.)

Then you'll be prompted for your password. Enter it, and the Software Center will run as root.

Please note that this is a little different from the way Software Center usually runs. Ordinarily, it runs as a normal user, and uses PolicyKit to perform actions as root just when it is needed. It would be non-trivial to get it to use gksu/gksudo or kdesudo to do that.

But running it as root typically works fine and causes no problems.

Other graphical utilities can be run as root with graphical sudo frontends, too.

The problem itself doesn't appear related specifically to the Software Center--any program that uses PolicyKit will fail. Some, like users-admin, cannot be run successfully as root. But most can. Here's how to do it, for some of the commonly used utilities:

  • Software Sourcesgksu software-properties-gtk
    (In Kubuntu: kdesudo software-propertiies-kde)

  • Software Updater (called Update Manager before 12.10) — gksu update-manager
    (If you just want to install updates normally, though, you may be able to do that without becoming root at all, as there is a separate service that allows this.)

  • System Settings...gksu gnome-control-center

Related Question