[>=17.10][<=19.04] How to install gksu (if you REALLY need it)

:warning: You should not ever need to do this.

Big bold print to emphasize the following: gksu is an obsolete piece of technology superseded by the GNOME virtual filesystem suite and GNOME PolicyKit (via pkexec). You seriously shouldn't have to use this, except in select instances where gksu is (for some reason) a package depend-ency. Wait on software to be updated, or make the tags of any developer blink for eons until they give a damn enough to fix it.

:code: Note to developers with actively-iterated software using gksu

Really, give a damn and fix it. Save your inbox the burden of bearing the wrath of a thousand suns and recode your authentication routine in a GTK app to use GNOME PolicyKit.

:question: Wasn't this already answered?

Yes, yes it was. Right here. But this is a terrible method as it involves mixing Ubuntu repositories from different versions. As one SX member put it:

:quote: There shall be misery and gnashing of teeth to the end of the age and beyond.

I will instead detail another answer from the same source material appended onto that very post with a different, more safe method which will ensure your chompers don't suffer from bruxism.

:biohazard: Risk of malicious software intervention

There have been software which had been able to work around, and even use gksu without user consent which until the recent removal of this software was becoming a more likely threat. Use of this software assumes such risk, and should only ever remain in your system at your own peril.

If you are alright with this, you may continue reading.


What was gksu?

Speculation about the name aside, the purpose of gksu (and by extension, gksudo though they are slightly different) is to provide a graphical frontend for the su command, so that software using GTK can prompt for authentication and provide a modal / dialog for users to provide their login credentials for superuser tasks. In instances where this was possible, it is usually for acting as root.

Why was it removed?

The GNOME developers believed that their PolicyKit implementation is a better alternative to gksu, as many behind the decision believed there isn't ever a reason a user would technically need to run a graphical application as a superuser, as its capability to be used with elevated privileges may not had been properly audited. See source at bottom for a more detailed answer from Ask Ubuntu.

Installation in modern Ubuntu

The getting

You will need the following packages. After following the links for each, select your system architecture, then the repository nearest your geographical location (or whatever is fastest).

:install: Software for gksu
libgtop-2.0-10 for Xenial (16.04)
libgksu2-0 for Xenial (16.04)
gksu for Xenial (16.04)

:clock3: If you save these files in a separate directory, installation can go much quicker.:open_file_folder:

The doing

Once all of those files are downloaded, you can then install as follows:

:fast_forward: For brevity, . assumes ~/Downloads. cd or use full paths to relevant location of files.

:asterisk: Assumes regex. If this isn't something your shell allows, Tab-complete instead.

:heavy_dollar_sign: In x-terminal-emulator:

sudo dpkg -i ./libgtop-2.0-10_2.32.0-1_*.deb
sudo dpkg -i ./libgksu2-0_2.0.13_pre1-6ubuntu8_*.deb
sudo dpkg -i ./gksu_2.0.2-9ubuntu1_*.deb

:memo: You can edit this command down further to a space-delimited list of packages in a single invocation of dpkg for this job, but wrap-around is disabled for code blocks here.

:open_file_folder: Remember what I said earlier about installing this more quickly? If you keep the three packages for making gksu useful in an entirely separate directory, you only need to do this:

:fast_forward:, :asterisk:

:warning: Do not do this unless you are sure only the packages you need exist where you had saved them. Unforeseen consequences may occur otherwise!

:heavy_dollar_sign: In x-terminal-emulator:

sudo dpkg -i ./*

Information sources

Why was gksu removed?

i3x's comment to initial post of this question:

Installing gksu in modern Ubuntu

M K's comment to N0rbert's response