Ubuntu – How GUI based apps ask for root password without gksudo installed

gksudosudo

In old ubuntu releases, I believe, GUI apps ask for root password using gksudo. Now gksudo not comes preinstalled in ubuntu. For me, if I am adding a custom launcher of a compiled executable which needs to be run as root, I need to install gksudo and add gksudo -k -u root, followed by the execution command. But in certain apps, like Synaptic Package Manager, Unetbootin ect, (which is installed via apt) can ask root password through GUI environment similar to good old gksudo. Actually How its being possible?

Best Answer

As ssta properly mentioned there is something known as pkexec which is part of policykit-1 package. You can verify that it is installed with dpkg --get-selections | grep policy . However, it doesn't necessarily mean it has a GUI front-end. The GUI front end is provided by another package - policykit-1-gnome for Unity and Gnome. For other desktop environments there are additional packages that provide GUI for their respective environment.

For more info on this tool refer to

Why is pkexec preferred over gksudo for graphical applications?

When to use pkexec vs. gksu/gksudo?