5

I'm not using Unity, so I don't have a handy button to click on to start software-center. It's occasionally useful to search for software, though, so I run it from the command line. However, then I can't actually install the software through that interface (no permissions). So I tried sudo software-center instead, hoping to fix that. After entering my password on the command line, I'm presented with a dialog box asking for:

Enter password for keyring 'default' to unlock

What should I enter here to get software-center to actually start up as root?

Here's some more information. I'm running Enlightenment (E17) as my desktop environment. The buttons that appear on the side bar in unity don't appear to have an equivalent in E17, which is why i'm running software-center from the command line. When i do so, as me instead of root, at the point where i try to install something, an error message pops up that says:

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

Policykit does not appear to be running, or at least nothing resembling that name shows up with "ps wux". So i guess that raises the question, would anyone know how to get that to start up automatically when i log in?

Thanks!

guntbert
  • 13,475

3 Answers3

6

You shouldn't be running software-center as root. You should simply launch it as your own user. Installing a package should prompt you with a policykit dialog box asking for your password. Is that not happening?

mdeslaur
  • 1,293
0

You need pkexec instead:

pkexec software-center

That way is like you were starting it from the GUI.

Braiam
  • 69,112
0

A good option is to use the following two commands:

sudo -i           #login as root
software-center   #run software-center as root

If you want to use pkexec software-center as @Braiam suggested in his answer you will most likely get some errors and the command leads to a core dump (as @gunbert said in this comment). The right way to run software-center as root using pkexec is:

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY software-center

And this is normal because man pkexec is very clear in this sense:

       [...] pkexec will not allow you to run X11 applications
       as another user since the $DISPLAY and $XAUTHORITY environment
       variables are not set.[...]

Also, see Why should users never use normal sudo to start graphical applications?

Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407