Page 1 of 1

gksudo dropped in LM 19 - goodness knows what else

Posted: Thu Jun 07, 2018 3:04 am
by pbear
I periodically drop by the Ubuntu forum to see what sort of fun they're having and noticed a thread about gksudo. Turns out it has been dropped in Ubuntu 18.04 and it's not yet clear what one is supposed to use instead.

Intrigued, I fire up the Cinnamon 19 beta I have installed in VirtualBox. Try running gksudo xed. No such command. Just to be sure, try man gksudo. Nope. Per linked thread, sudo -H xed works, but unclear whether that avoids the permissions issues for which we were using gksudo in the first place. To round out the picture, I take a look at the Mint Release Notes and the Ubuntu Release Notes, neither of which mention the change.

Wonder what else has changed. Not asking for advice. Just running up the flag pole as FYI to the community.

gksu dropped in LM 19

Posted: Thu Jun 07, 2018 3:32 am
by pdc_2
so this has been mentioned in various threads etc

eg https://itsfoss.com/gksu-replacement-ubuntu/

if before you would have done

Code: Select all

gksudo gedit /etc/default/apport
now they deferentially request you do

Code: Select all

gedit admin:///etc/default/apport


this link also covers the topic https://www.linuxuprising.com/2018/04/g ... heres.html

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Thu Jun 07, 2018 3:48 am
by Sir Charles
It has been (is being) discussed in L M Forums as well. See:viewtopic.php?f=61&t=268140
pbear wrote:
Thu Jun 07, 2018 3:04 am
Wonder what else has changed.
I haven't been running LM 19 beta that much yet, but one change, major in my opinion, that I have noticed, is the change to the update policy. Fire up the Update Manager and have a look at the preferences and all the already by default checked options and levels. There is now the possibility to "opt in" for automatic updates.

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Thu Jun 07, 2018 4:11 am
by Pjotr
Short summary:

For editing system config files, use xed in combination with admin://. For example, for editing /etc/default/grub:

Code: Select all

xed admin:///etc/default/grub
(Note the three consecutive dashes)

The first time you use admin:// in a session, you'll be asked for your password twice.

For file management with root permissions, use pkexec:

Cinnamon:

Code: Select all

pkexec nemo
Mate:

Code: Select all

pkexec caja
Xfce:

Code: Select all

pkexec thunar

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Thu Jun 07, 2018 7:55 am
by Hoser Rob
Mint 19 is based on Ubuntu 18.04. So pretty much all changes in Ubuntu 18.04 not related to a specific DE will also change in Mint 19.

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Thu Jun 07, 2018 8:20 am
by altair4
Fun fact:

The only distribution that enables a one-to-one substitution of pkexec for gksu automatically for its default editor AND file manager is Xubuntu 18. OK ... OK ... there are 15642 Linux distros out there so there may be another.

pkexec requires a policykit "rule" for ever application that wants to use it. In Xubuntu one is already created for thunar ( /usr/share/polkit-1/actions/org.xfce.thunar.policy ) and one is already created for mousepad ( /usr/share/polkit-1/actions/com.ubuntu.pkexec.mousepad.policy ).

In Mint's XFCE edition there is the same one for thunar but none for xed. At least not in the Beta version so far.

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Thu Jun 07, 2018 11:01 am
by pbear
When discussing Linux with folks in real life, I'm careful to caution, "Yes it's free, but it's also complicated and very poorly documented."

Enough. So long, and thanks for all the fish.

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Thu Jun 07, 2018 3:38 pm
by Pjotr
pbear wrote:
Thu Jun 07, 2018 11:01 am
"Yes it's free, but it's also complicated and very poorly documented."
Complicated: not really, usually.... Poorly documented: absolutely! Developers like to develop, and unfortunately not to explain. This is a real shortcoming, but that's where other people can jump in to help....

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Thu Jun 07, 2018 4:36 pm
by slipstick
pbear wrote:
Thu Jun 07, 2018 11:01 am
When discussing Linux with folks in real life, I'm careful to caution, "Yes it's free, but it's also complicated and very poorly documented."
I just started reading this. It is intended to be humorous (I think), but there is a lot of truth in there and much of it applicable to Linux, unfortunately.
The UNIX-HATERS Handbook

the strength of the forum

Posted: Thu Jun 07, 2018 7:09 pm
by pdc_2
Yes it's free, but it's also complicated
I guess if one has got to use gksu or gksudo then one has climbed part-way up the mountain; so kudos there: more expert than one might think!!

often what seems hard is because it is new; practice makes permanent;

If we can't practice using the script; or technique; or phrase;

then in a nice friendly forum like Mint, we can ask others for help; what I really like is to see folks who I regard as really knowledgable; posting issues they have had; and asking for help from others; I think that is great;

there seem to be folks on the forum who may well use linux in their work each day; they post very fluent and deeply experienced pieces of advice; how great is that;

what I taken on board recently was the coaching to "advocate then enquire": so you say out loud what you are thinking; and you ask others for their views; their views help one re-assess one's one views; then you say 'em again; changed;

whilst Bob Geldof sang (tongue in cheeh!!) ......."I am an island, entire of myself I am an island" .....maybe it doesn't work for the rest of us ..

(I am sure this is going to get shunted off to Chat!!)

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Thu Jun 07, 2018 9:47 pm
by Kilz
It appears lxqt-sudo is still available and does pretty much the same thing.

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Fri Jun 08, 2018 12:57 am
by kukamuumuka
It will cause a massive sudo abuse. :(

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Fri Jun 08, 2018 1:38 am
by lmuserx4849
pbear wrote:
Thu Jun 07, 2018 3:04 am
...
Wonder what else has changed. Not asking for advice. Just running up the flag pole as FYI to the community.
All releases have "Release Notes" and "Announcements". Also, highly recommend reading Clem's LM blog.

Go to Download > All Versions > Select 19, then select your Desktop & Arch, and you'll find the links to "Releases Notes" and "Announcements". At the bottom, there is a link to "Ubuntu release notes". This won't cover everything, but it's a good start :-)
Gksu, which used GTK+, was removed and all the tools which were using it were migrated to pkexec.
https://www.linuxmint.com/rel_tara_cinn ... atsnew.php
https://linuxmint.com/rel_tara_mate_whatsnew.php
LM 19 is based on Ubuntu 18.04. If there is some software you use a lot, you could search for it and see what version will be installed on 18.04, thus LM 19. I was kind of disappointed to see gimp 2.8 and not 2.10. At least libreoffice is 6.0.3, although 6.0.4 is out.

I'm on 17.3 now, so I get to learn all about systemd, journald, etc. I've been keeping up to date on gimp, libreoffice, and some other utilities and development stuff. The biggest change will be desktop. I'm currently using KDE, going to try Mate. I may go to debian or suse, if I can't break from kde. I like the rolling release of Arch, but I've had major problems with it. The LTS is a little to long for me.

UPDATE: I see you already looked at the Release Notes. You need to go one link further, "What's new in Linux Mint 19 Cinnamon".

Re: the strength of the forum

Posted: Fri Jun 08, 2018 1:56 am
by Moem
pdc_2 wrote:
Thu Jun 07, 2018 7:09 pm
I guess if one has got to use gksu or gksudo then one has climbed part-way up the mountain; so kudos there: more expert than one might think!!
This is true. I've been using Mint for two years now and I've never felt the need to use either.
(I am sure this is going to get shunted off to Chat!!)
You seem to be trying to force my hand. Don't do that, okay?

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Fri Jun 08, 2018 1:59 am
by lmuserx4849
pbear wrote:
Thu Jun 07, 2018 11:01 am
When discussing Linux with folks in real life, I'm careful to caution, "Yes it's free, but it's also complicated and very poorly documented."

Enough. So long, and thanks for all the fish.
Just to clarify:
“Free software” is a matter of liberty, not price.

“Open source” is something different: it has a very different philosophy based on different values. Its practical definition is different too, but nearly all open source programs are in fact free. We explain the difference in Why “Open Source” misses the point of Free Software.

“Free software” means software that respects users' freedom and community. Roughly, it means that the users have the freedom to run, copy, distribute, study, change and improve the software. Thus, “free software” is a matter of liberty, not price. To understand the concept, you should think of “free” as in “free speech,” not as in “free beer”. We sometimes call it “libre software,” borrowing the French or Spanish word for “free” as in freedom, to show we do not mean the software is gratis.

http://www.gnu.org/philosophy/free-sw.html
Out of curiosity, how are non-linux environments better documented or easier?

man pages are maintained, applications have [h]elp options, the installation doc directory (/usr/share/doc) has additional information, and there is always the source. In the early '90's, when users bought distributions at a brick and mortar store (i.e., CompUSA) there were hardcopy manuals. Today RedHat, OpenSuSE, archlinux have great online documentation. Various applications have good doc too (i.e., libreoffice, gimp...). In this environment, we all should be volunteering or donating money to projects. There are also hard copy books: Linux Bible, How Linux Works, UNIX and Linux System Administration Handbook, Debian Handbook.... As far as desktops go, imho, KDE is much better documented than GNOME and its' forks.

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Fri Jun 08, 2018 9:09 am
by greerd
altair4 wrote:
Thu Jun 07, 2018 8:20 am
pkexec requires a policykit "rule" for ever application that wants to use it. In Xubuntu one is already created for thunar ( /usr/share/polkit-1/actions/org.xfce.thunar.policy ) and one is already created for mousepad ( /usr/share/polkit-1/actions/com.ubuntu.pkexec.mousepad.policy ).

In Mint's XFCE edition there is the same one for thunar but none for xed. At least not in the Beta version so far.
I put the pkexec xed problem, or lack of a polkit rule, on the Mint 19 cinnamon blog. Odyseus answered with a work around pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xed. Lots of typing but works good. Or another way to run xed privileged is to run it from within a privileged nemo, pkexec nemo then open up your file with xed and privileges are inherited.

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Fri Jun 08, 2018 10:04 am
by Pjotr
greerd wrote:
Fri Jun 08, 2018 9:09 am
altair4 wrote:
Thu Jun 07, 2018 8:20 am
pkexec requires a policykit "rule" for ever application that wants to use it. In Xubuntu one is already created for thunar ( /usr/share/polkit-1/actions/org.xfce.thunar.policy ) and one is already created for mousepad ( /usr/share/polkit-1/actions/com.ubuntu.pkexec.mousepad.policy ).

In Mint's XFCE edition there is the same one for thunar but none for xed. At least not in the Beta version so far.
I put the pkexec xed problem, or lack of a polkit rule, on the Mint 19 cinnamon blog. Odyseus answered with a work around pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xed. Lots of typing but works good. Or another way to run xed privileged is to run it from within a privileged nemo, pkexec nemo then open up your file with xed and privileges are inherited.
This is a much better way to do it:
viewtopic.php?f=47&t=270721#p1478156

... and I've put that on the blog, as well. :)

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Fri Jun 08, 2018 10:58 am
by greerd
Pjotr wrote:
Fri Jun 08, 2018 10:04 am
This is a much better way to do it:
viewtopic.php?f=47&t=270721#p1478156

... and I've put that on the blog, as well. :)
Yea, I tried that, and it works but there is no Elevated Privileges red bar across the top, I like the red bar. Hopefully they'll add a polkit rule for xed.

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Fri Jun 08, 2018 12:22 pm
by altair4
greerd wrote:
Fri Jun 08, 2018 9:09 am
altair4 wrote:
Thu Jun 07, 2018 8:20 am
pkexec requires a policykit "rule" for ever application that wants to use it. In Xubuntu one is already created for thunar ( /usr/share/polkit-1/actions/org.xfce.thunar.policy ) and one is already created for mousepad ( /usr/share/polkit-1/actions/com.ubuntu.pkexec.mousepad.policy ).

In Mint's XFCE edition there is the same one for thunar but none for xed. At least not in the Beta version so far.
I put the pkexec xed problem, or lack of a polkit rule, on the Mint 19 cinnamon blog. Odyseus answered with a work around pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xed. Lots of typing but works good. Or another way to run xed privileged is to run it from within a privileged nemo, pkexec nemo then open up your file with xed and privileges are inherited.
Just for giggles I copied /usr/share/polkit-1/actions/com.ubuntu.pkexec.mousepad.policy from Xubuntu, changed all the references from mousepad to xed, removed some fluff, and ended up with this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>

  

 <vendor>xed</vendor>
 <vendor_url>http://gnome.org/</vendor_url>
 <icon_name>text-editor</icon_name>


 <action id="org.gnome.xed">
 
 <description>Run xed as root</description>
 
 <message>Authentication is required to run xed as root.</message>
 
 <defaults>
 <allow_any>no</allow_any>
 <allow_inactive>auth_admin</allow_inactive>
 <allow_active>auth_admin</allow_active>
 </defaults>
 <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/xed</annotate>
 <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
 </action>

</policyconfig
Then added it as: /usr/share/polkit-1/actions/com.ubuntu.pkexec.xed.policy to Cinnamon 19.
Seems to work:
pkexec-zed.png
pkexec-zed.png (31.37 KiB) Viewed 2930 times
I did get a curious error when closing it though - which I do not get when I run pkexec mousepad in Xubuntu: Set document metadata failed: Setting attribute metadata::xed-position not supported

Anyway, I'm not recommending anyone else do this as I'm obviously doing something wrong since this whole thing would take about 15 nanoseconds for someone who knew what they were doing.

Re: gksudo dropped in LM 19 - goodness knows what else

Posted: Fri Jun 08, 2018 1:36 pm
by greerd
altair4 wrote:
Fri Jun 08, 2018 12:22 pm
Cool, I used your file and it looks to be working good. I not getting any 'xed-position not supported' error. I added '_keep' to allow_active similar to org.nemo.root.policy (auth_admin_keep) which I think starts a timer. But yea, it would be nice for an official rule!

Thanks

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">

<policyconfig>

 <vendor>xed</vendor>
 <vendor_url>http://gnome.org/</vendor_url>
 <icon_name>text-editor</icon_name>


 <action id="org.gnome.xed">
   <description>Run xed as root</description>
   <message>Authentication is required to run xed as root.</message>
   <defaults>
    <allow_any>no</allow_any>
    <allow_inactive>auth_admin</allow_inactive>
    <allow_active>auth_admin_keep</allow_active>
   </defaults>
  <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/xed</annotate>
  <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
 </action>

</policyconfig