Brief: gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version. You can achieve the gksu functionality with gvfs admin backend. Here’s how to do that.

I am exploring Ubuntu 18.04 these days. And when I was trying to suppress the Ubuntu crash report, I tried to use a command with gksu.

I was slightly surprised to find it not installed by default so I went on to install it. And this is where my surprise turned into a shock.

When I tried using sudo apt install gksu, my system told me “Package ‘gksu’ has no installation candidate“.

The complete error was this:

Reading package lists... Done Building dependency tree Reading state information... Done Package gksu is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'gksu' has no installation candidate

This made me do some little investigation and I found that gksu has been deprecated. It was first removed from Debian and then Canonical decided to drop it from Ubuntu 18.04. Application developers are suggested to use PolicyKit instead.

What is/was gksu?

gksu was the program that provided a GTK frontend for su and sudo. This way graphical applications were allowed to be run with root privileges.

As an end user, you might have used gksu to run Gedit editor for modifying some system files that required root privileges.

Since gksu is no more, what can you do if you need to open a program like Gedit as superuser?

Editing system files without gksu in Ubuntu 18.04 and other Linux

Users have been advised to use gvfs admin backend. Keeping technical jargon aside, it means that you should add admin:// prefix to the path of the file you want to edit.

So, if you were using a command like this with gksu:

gksu gedit /etc/default/apport

You can use the following command instead:

gedit admin:///etc/default/apport

This way you can still edit system files without gksu.

Alternative: Use pkexec

You may also use pkexec command instead of gksu. But it may need to have a policy kit in place for the application you are trying to run.

pkexec gedit

I know a lot of us Linux users got used of gksu and as gksu is deprecated, it does pose a little inconvenience. There is little we can do at our end except for using admin:// prefix.

I hope this article helped you with gksu issue in Ubuntu 18.04 and other Linux distributions. If you have questions or suggestions, please feel free to use the comment section below.