Use pkexec
instead of gksu
The use of gksu
and gksudo
is not recommended any more. The recommended method is to use Polkit. The easiest way to add Polkit files for Nautilus
is to install nautilus-admin
To install nautilus-admin
in Ubuntu, open a terminal by pressing Ctrl+Alt+T and use the following command:
sudo apt-get install nautilus-admin
The rest involves editing the `nautilus.desktop file and adding the correct command:
Copy the nautilus.desktop
file, representing nautilus in the launcher, from the global directory /usr/share/applications
to ~/.local/share/applications
cp /usr/share/applications/nautilus.desktop ~/.local/share/applications
Open the file with (e.g.) gedit
, look for the line:
Actions=Window;
Change it into:
Actions=Window;Open as Administrator;
Add to the very end of the file:
[Desktop Action Open as Administrator]
Name=Open as Administrator
Exec=pkexec nautilus
Save and close the file.
The added bonus of installing nautilus-admin
is that within Nautilus
you will also get Open as Administrator / Edit as Administrator items for folders / text files in the right click context menu. See How do I start Nautilus as root? for more details.
Hope this helps
.desktop
file in the launcher, so even if you take the answers as a criterion (which you shouldn't) , it would be outdated. – Jacob Vlijm Dec 15 '15 at 10:10