By default, pkexec can’t run graphical applications without having a PolicyKit file installed in /usr/share/polkit-1/actions/ for the app you’re trying to run as root, and Ubuntu doesn’t ship with PolicyKit files for Nautilus.

wget https://raw.githubusercontent.com/hotice/webupd8/master/org.gnome.nautilus.policy -O /tmp/org.gnome.nautilus.policy

sudo cp /tmp/org.gnome.nautilus.policy /usr/share/polkit-1/actions/

nano ~/.local/share/applications/nautilus-root.desktop

=====
[Desktop Entry]
Name=Files (Root)
Comment=Access and organize files as Root
Exec=pkexec nautilus --new-window %U
Icon=org.gnome.Nautilus
Terminal=false
# NoDisplay=true
Type=Application
StartupNotify=true
OnlyShowIn=GNOME;Unity;
Categories=GNOME;GTK;Utility;Core;
MimeType=inode/directory;application/x-gnome-saved-search;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=nautilus
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.2.1
X-Ubuntu-Gettext-Domain=nautilus
=====
Living in Tune with Nature's Beat (Earth, Water, Fire, Air, Space)

Leave a Reply

Your email address will not be published. Required fields are marked *