[arch-general] [Bulk] Re: gparted cant take root priviliges

Ralf Mardorf ralf.mardorf at rocketmail.com
Fri Jul 11 06:33:45 EDT 2014


On Fri, 2014-07-11 at 09:25 +0200, Runiq wrote:
> On 10.07.2014 18:59:17, Daniel Micay wrote:
> >On 10/07/14 06:56 PM, Klearchos-Angelos Gkountras wrote:
> >>In my new laptop, I install archlinux and works fine but also when I 
> >>try to use gparted not promont one dialog to have root priviliges...  
> >>how to fix that?
> >
> >I'm a bit unsure about what you're asking for. To avoid the error, you 
> >should run it with root privileges with a command like `pkexec 
> >gparted`.
> 
> What's the advantage of pkexec over sudo in this case?

I guess you mean what's the advantage of a graphical frontend for sudo,
e.g. gksudo over pkexec. The advantage of pkexec over sudo is that you
are prompted for the password by a GUI, so you can launch it e.g. from
the applications menu of a desktop environment, without the need to
start it in a terminal emulation.

If you want to run a GUI app, e.g. Firefox as user B, while you're in a
user A's X session, you need to do something like this:

xhost + ; gksudo -u B firefox

xhost + is a sledgehammer, I anyway use it that way, xhost could be used
smarter.

However, if you instead run

xhost + ; pkexec --user B firefox

you get "Error: no display specified", not to mention that you need to
launch /usr/lib/lxpolkit/lxpolkit or similar before you can use pkexec,
IOW IMO it's a disadvantage to preffer pkexec over gksudo, but it's
always mentioned that it should be better to use pkexec instead of
gksudo, some argue that xhost + isn't needed with pkexec, but without
xhost + I also get "Error: no display specified". Perhaps after writing
complicated polkit rules it would work.



More information about the arch-general mailing list