Ask Your Question

no gksudo? so just su or sudo then?

asked 2012-12-03 11:33:08 -0500

lenrev gravatar image

Hi, I'm a Fedora newbie, I'm trying to run some applications with GUI as root and for that I've gotten used to typing 'gksudo [command]'.

My question is how to run an app with GUI as root without using gksudo?

please help me, I just don't want to go back to Ubuntu.

edit retag flag offensive close merge delete


Can PolicyKit be a total replacement for sudo?

q2dg gravatar imageq2dg ( 2014-01-29 13:04:21 -0500 )edit

5 Answers

Sort by » oldest newest most voted

answered 2012-12-03 12:00:00 -0500

sten gravatar image

Fedora doesn't have gksudo, because it uses PolicyKit instead. The short answer to your question is, yes, use sudo.

The long answer is, if you'd rather have a GUI prompt, either you or the maintainer of the application you want to run can implement PolicyKit rules. Docs start here:

edit flag offensive delete link more


Probably not! What are you actually trying to do?

randomuser gravatar imagerandomuser ( 2012-12-13 09:14:22 -0500 )edit

answered 2016-01-04 23:57:44 -0500

The thing is that if you want to run as root a graphical application you have 2 ways:

1.- Open the terminal and type:

$ sudo app_name


2.- Add a policy kit rule:

In /usr/share/polkit-1/actions you have to create a xml file with the information about the application you want to run with privileges. In my case I wanted to run glogg cos I need to open system log files and had to be root for that.

After you create the xml file you have to edit the .desktop file in /usr/share/applications, adding before the binary name, the pkexec command.

That's all. Then you've got your application asking for root password.

For glogg I create this XML, named org.freedesktop.policykit.pkexec.glogg.policy (path: /usr/share/applications/)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"

    <vendor>Nicolas Bonnefon</vendor>

    <action id="org.freedesktop.policykit.pkexec.glogg">
    <description>Run glogg with elevated privileges</description>
    <message>Authentication is required to run glogg as root</message>
    <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/glogg</annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>


And the glogg.desktop file (path: /usr/share/applications):

[Desktop Entry]
GenericName=Log file browser
# %f because glogg supports only one file for now
Exec=pkexec glogg %f
Comment=A smart interactive log explorer.

[Desktop Action Session]
Exec=pkexec glogg --load-session %f
Name=Open With Previous Session

[Desktop Action NewInstance]
Exec=pkexec glogg --multi %f
Name=Open In A New glogg Window
edit flag offensive delete link more

answered 2014-01-29 04:13:53 -0500

Dennis gravatar image

i found a PolicyKit alternative called pkexec

usage is

pkexec [--user username] PROGRAM [ARGUMENTS...]
edit flag offensive delete link more

answered 2012-12-03 12:34:51 -0500

hhlp gravatar image

Beesu is a wrapper around su and works with consolehelper under Fedora to let you have a graphic interface like gksu


sudo yum install beesu
edit flag offensive delete link more


It helped me with another question that took me sometime to solve. How to create a Shortcut [Desktop Entry] to open as root! Thanks a lot!

Danielson Júnior gravatar imageDanielson Júnior ( 2016-02-16 07:24:02 -0500 )edit

answered 2012-12-03 11:40:59 -0500

ThomasMcA gravatar image

I recently switched from Kubuntu to Fedora XFCE, and I use kdesu in my GUI shortcuts. To find out if you have kdesu, run which kdesu in a console. If it returns a path (like /bin/kdesu) then kdesu will work on your system.

edit flag offensive delete link more

Question Tools


Asked: 2012-12-03 11:33:08 -0500

Seen: 32,501 times

Last updated: Jan 04 '16