35

Turns out gksu is no longer installed by default. Some things still depend on it so it might be installed on your system - but on a clean install, it seems it's no longer required. As for why, see: Why is gksu no longer installed by default?

Historically we have used gksu a lot here but this means that in the future, we should probably scale down its use in favour of plain sudo (or sudo -i). Use the comments and answers to hammer out a best-practice if you feel there is a technical issue here.

There is a compelling argument that we move to pkexec. I just tried it here (on Kubuntu 13.04) and it worked beautifully from the terminal, a run box and from a TTY (it has a text-only mode too), but it doesn't work on a 12.04 headless server and I don't know how this works on older desktops. Comments?

Note: I'm not suggesting an edit storm!

I am not saying we should nuke every example of gksu. Users will be prompted to install it and they can do that...

I'm only suggesting that if you're writing a new answer, you avoid gksu.

Edit: If you need to edit something, concentrate on answers about 13.04 and newer.

In this case a quick search will work:

This query will probably return more results in time, but hopefully by posting this PSA now, we'll stop too many new answers showing incorrect information.

And once more, if you edit, please make sure you're replacing it with the right thing.

7
  • 11
    Man, this is going to be rough.
    – jrg
    Apr 29, 2013 at 12:29
  • It is still installed by default in Xubuntu 13.04 though... Apr 30, 2013 at 17:52
  • @Oli will the "quick search" you gave also find posts containing "gksudo" and [13.04]? Or do we need another search? Excuse my ignorance but I'm a relative newbee to Stack exchange sites though I have been doing my best to support Linux (and Ubuntu in particular) for some time now. Apr 30, 2013 at 21:27
  • @StephenMichaelKellat That may be, but I think unless it's super-Xubuntu-specific, it's just safer to avoid for the moment.
    – Oli Mod
    May 1, 2013 at 7:52
  • @WarrenHill I assumed it did but no it didn't. Thankfully the search supports wildcards, so I've just updated it. Thanks for thinking twice about it :)
    – Oli Mod
    May 1, 2013 at 8:31
  • It's not installed in Xubuntu now - and pkexec just fails atm in 13.10 Nov 12, 2013 at 17:33
  • erg... askubuntu.com/questions/313828/…
    – Mateo
    Aug 8, 2014 at 19:58

2 Answers 2

10

From the discussions I have had since asking the question you refer to and before providing the answer I gave it seems that for raring at least there is no problem with installing and using gksu. However in the longer term some of the developers want to phase it out.

They believe policy-kit offers finer control and pkexec is a front end to that.

We need to be careful telling people to use sudo with graphical programs as while it's normally OK, there can be problems has has been explained in several questions on Ask Ubuntu such as this one.

It will be easier for users if we stick to one method for graphical programs as otherwise we will need to maintain a list of which commands can use sudo and which ones need more care.

sudo -i is safe since $HOME and $PATH are those of the root user which is how gksu and gksudo works. This would be my preference.

Edit: Based on a comment from Paddy Landau on the original question; that gksudo and gksu are not the same; and my subsequent investigation as a result confirming this. We (and this includes me) should never have recommended gksu: gksudo is safer though it appears that there are very few cases where it matters.

sudo -i remains a safe solution on all currently supported versions of Ubuntu.

1
  • 1
    One thing I hate about such changes is that I don't know what I'm supposed to use. gksu is gone, so what now? Ubuntu should tell me, that it's deprecated, and I should use 'pkexec'. Should we make a bugreport about this?
    – Apache
    Jun 1, 2013 at 10:20
4

Why not simply apply this to 13.04 questions. We might edit some questions that also include 13.04 or the OP mentions his final version in use as 13.04, but for newer ones, we now know this has change and work with it.

2
  • 2
    Yeah, I've just added a bit to the bottom of the question that links to questions tagged 13.04 with answers that contain gksu.
    – Oli Mod
    Apr 29, 2013 at 13:29
  • @Oli Great idea. Will save us time. Apr 29, 2013 at 13:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .