Ordinarilly you would use gksu
instead of sudo
to launch gui programs, but as demure said in notes above, this has been deprecated, and you should use pkexec
now instead.
By default this does not support gui programs however. So you need to configure them to run. Once configured you will be able to run them from the command line using:
pkexec bleachbit
To configure you need to edit\create the file /usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.policy
. For example, using nano
...
pkexec nano /usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.policy
You then, for the programs you specify, need to add the following content to the file...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<action id="org.freedesktop.policykit.pkexec.run-gedbi">
<description>Run gedbi</description>
<message>Authentication is required to run gedbi</message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/gedbi</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate>
</action>
<action id="org.freedesktop.policykit.pkexec.run-bleachbit">
<description>Run bleachbit</description>
<message>Authentication is required to run bleachbit</message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/bleachbit</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate>
</action>
</policyconfig>
You can add additional programs in this way, or if you prefer, there is a bash script for adding additional programs to the config file automatically.
sudo apt-get install gksu
. https://help.ubuntu.com/community/RootSudo – Panther May 24 '13 at 18:27gksu bleachbit
ect. gksu is for graphical applications, sudo for command line. Use your user log in. I would also look at using strong passwords as a one letter password is not ideal. – Panther May 24 '13 at 18:40gksu
deprecated bypkexec
on current ubuntu versions? – demure May 24 '13 at 18:56gksu-properties
and change the "Authentication mode" to "sudo" and close. Now dogksu bleachbit
, or whatever GUI application you want to run as root, and type your password (the one you use for updating and installing). – Alaa Ali Jun 11 '13 at 18:39