Allen Guarnes

Resolving the missing ‘gksu’ command in Ubuntu 18.04

Disclaimer: I’m actually using Lubuntu 18.04, so there may be slight differences depending on which Ubuntu flavor you’re using.

Starting from Ubuntu 18.04 (or maybe some version after 16.04), the ‘gksu’ package was completely removed from Ubuntu’s repositories. I have no idea why and when, and I might not really care that much as to how they arrived with the decision to remove it, so I’m not going to talk about it because it’s not really important [to me].

Anyhow, minutes of searching Google led me to using the old ‘pkexec’ command. The problem with this is that policy files have to be made, otherwise an error would be displayed. I think it was something along ‘cannot be displayed’. But I needed to use ‘pkexec’ command on both leafpad and pcmanfm, so I made the following files to fix the issue:

These files should be saved to /usr/share/polkit-1/actions.

After adding those, you should already be able to run the following:

pkexec leafpad <file_path>


pkexec pcmanfm <directory_path>

without any issues whatsoever.

Both files are here:

Custom PCManFM Actions for Lubuntu 18.04

My old custom PCManFM actions no longer work because gksu is gone so I needed to fix that too.

To do that, I did the following steps.

P.S. I do not claim these to be the best solution. Feel free to comment if there is an easier way to accomplish these.

Open terminal and change the directory.

cd /usr/bin

Copy the file synaptic-pkexec as our template, otherwise skip these steps and just create the file and permissions manually on your own.

sudo cp synaptic-pkexec leafpad-pkexec
sudo cp synaptic-pkexec pcmanfm-pkexec

Edit leafpad-pkexec and pcmanfm-pkexec:

Then add these files to ~/.local/share/file-manager/actions:

All the files are here:

If someone has a better way, please do tell!


  1. Works great on Arch Linux Too!

  2. Utilizing your method and policy files, C4C Lubuntu 18.04 ReSpin users (myself included) were able to *continue to* easily open PCManFM as root. This basic File Manager function has been re-added and should be available in the C4C Lubuntu 20.04 ReSpin, but I wanted to thank you for posting this fix we’ve all used for almost two years now.

  3. Thnx a lot dude!

  4. It works ! 😀

    Thank you so much from Italy ! Thank you ! 🙂

Leave a Reply