gksu removed from the repo's of Ubuntu 18.04

Chat about Linux in general
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
mattlach
Level 4
Level 4
Posts: 323
Joined: Mon May 30, 2011 8:34 pm

Re: gksu removed from the repo's of Ubuntu 18.04

Post by mattlach »

Pjotr wrote: Sat Apr 21, 2018 5:41 am Unpleasant news: gksu has been removed from the repo's of Ubuntu Bionic:
https://jeremy.bicha.net/2018/04/18/gks ... om-ubuntu/

For Mint 19, this'll also affect Synaptic, GParted, Mints Update Manager, etc. And for editing system config files, it almost feels as if we're being pushed towards abusing "sudo". :shock:

I never understood why people used gksu when sudo exists. What do you like about it more? They accomplish the same thing, and sudo is much simpler since it is console based.
Corsair 1000D, Threadripper 3960x, Asus ROG Zenith II, 64GB, Samsung 990 Pro, Geforce RTX 4090, 42" LG C3, 2x Dell U2412M, Schiit Bifrost Multibit DAC
Server: AMD EPYC 7543(32C/64T), SuperMicro H12SSL-NT, 512GB RAM, 192TB ZFS
User avatar
Pjotr
Level 24
Level 24
Posts: 20123
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: gksu removed from the repo's of Ubuntu 18.04

Post by Pjotr »

mattlach wrote: Wed Feb 13, 2019 6:33 pm I never understood why people used gksu when sudo exists. What do you like about it more? They accomplish the same thing, and sudo is much simpler since it is console based.
Hopefully this'll help you understand:
https://easylinuxtipsproject.blogspot.c ... -root.html

Golden oldie with much more background information:
http://www.psychocats.net/ubuntu/graphicalsudo

Golden oldie summarized in two lines:
Bottom line: most of the time when you use sudo for graphical applications, it's fine. Some of the time, though, it is not fine, and is, in fact, extremely bad.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
lewtwo
Level 4
Level 4
Posts: 254
Joined: Wed Oct 29, 2014 8:33 pm
Location: Houston, Texas

Re: gksu removed from the repo's of Ubuntu 18.04

Post by lewtwo »

Pjotr wrote: Wed Feb 13, 2019 6:57 pm Bottom line: most of the time when you use sudo for graphical applications, it's fine. Some of the time, though, it is not fine, and is, in fact, extremely bad.
Well said.
"Engineering is the art of planning and forethought."
http://www.keywild.com
mattlach
Level 4
Level 4
Posts: 323
Joined: Mon May 30, 2011 8:34 pm

Re: gksu removed from the repo's of Ubuntu 18.04

Post by mattlach »

Pjotr wrote: Wed Feb 13, 2019 6:57 pm Golden oldie summarized in two lines:
Bottom line: most of the time when you use sudo for graphical applications, it's fine. Some of the time, though, it is not fine, and is, in fact, extremely bad.
Interesting. In my 18 years of using one Linux distribution or another as my primary desktop OS, I've never had anything extremely (or even mildly) bad happen as a result. I guess I've just been lucky?
Corsair 1000D, Threadripper 3960x, Asus ROG Zenith II, 64GB, Samsung 990 Pro, Geforce RTX 4090, 42" LG C3, 2x Dell U2412M, Schiit Bifrost Multibit DAC
Server: AMD EPYC 7543(32C/64T), SuperMicro H12SSL-NT, 512GB RAM, 192TB ZFS
User avatar
Pjotr
Level 24
Level 24
Posts: 20123
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: gksu removed from the repo's of Ubuntu 18.04

Post by Pjotr »

mattlach wrote: Wed Feb 13, 2019 9:38 pm
Pjotr wrote: Wed Feb 13, 2019 6:57 pm Golden oldie summarized in two lines:
Bottom line: most of the time when you use sudo for graphical applications, it's fine. Some of the time, though, it is not fine, and is, in fact, extremely bad.
Interesting. In my 18 years of using one Linux distribution or another as my primary desktop OS, I've never had anything extremely (or even mildly) bad happen as a result. I guess I've just been lucky?
Dunno. But I strongly advise to apply this sanitizing command, which should restore the ownership of all your user files to their rightful owner:

Code: Select all

sudo chown -R -v $USER:$USER $HOME
.... and from then on, sin no more. :mrgreen:
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
robsku
Level 1
Level 1
Posts: 21
Joined: Tue May 21, 2019 5:27 am
Location: Helsinki, Finland

Re: gksu removed from the repo's of Ubuntu 18.04

Post by robsku »

What, this is not good! pkexec seems to be just a su-replacement, while I want a GUI sudo-equivalent. I wrote a script that used sudo twice, replaced the first with gksudo, so the script launched from desktop would ask password once, then the second command would just run, since the permission was still active.
I replaced the gksudo with pkexec, and the second command didn't work (in console it asked a password). Now I just made a launcher to the script that has command "pkexec ~/scripts/mouse" and removed pkexec and sudo from the script, and it works... but it should just graphically ask for the password ONCE.

I wan't GUI sudo equivalent, not GUI su.

Besides, gksu and gksudo made sense, as does su and sudo, but pkexec, confused is that? Well, it's not sudo, that's for sure. I want my GUI sudo wrapper back!

Oh well, there are alternatives to GUI sudo.
Jani "Sir Robin" Saksa,
Peace, Linux & Love
My website will be back (eventually)
User avatar
robsku
Level 1
Level 1
Posts: 21
Joined: Tue May 21, 2019 5:27 am
Location: Helsinki, Finland

Re: gksu removed from the repo's of Ubuntu 18.04

Post by robsku »

trytip wrote: Mon Aug 20, 2018 2:27 pm
Mr_Sinister wrote: Thu Jul 05, 2018 8:00 am Just upgraded from 18.3 to 19 and this particular feature is gone. And I need it badly.
open .bashrc and at the bottom add these lines:

Code: Select all

alias gksu=pkexec
alias pkexec='pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY'
Still, what would I use to replace gksudo? I mean, I have a script that is meant to be driven from GUI, and it uses gksudo to provide GUI window for asking password, then for the rest of the commands needing root priviledges it uses plain sudo, because the sudo permissions should remain for some time without needing to ask again.

I know there are 3rd party replacements... I'd prefer default tools.
WTH has anyone against gksudo's availability, they are not going to remove regular su and sudo anyway - ARE THEY!?
Jani "Sir Robin" Saksa,
Peace, Linux & Love
My website will be back (eventually)
User avatar
robsku
Level 1
Level 1
Posts: 21
Joined: Tue May 21, 2019 5:27 am
Location: Helsinki, Finland

Re: gksu removed from the repo's of Ubuntu 18.04

Post by robsku »

xenopeek wrote: Sat Apr 21, 2018 6:19 am You're mistaken; this is in fact good and welcome news! It should be celebrated that Ubuntu (finally) reached this milestone.

gksu hasn't been maintained for many years and was only left to rot in the Ubuntu repository because some programs unfortunately still depended on it. Such programs have been migrating to PolKit's pkexec. Your examples of Synaptic, GParted and Update Manager all use pkexec now (if they didn't already before). PolKit allows for finer level of control than was possible with gksu. No longer does the entire program need to run as root.

In short; removing gksu doesn't meaningfully affect users of Ubuntu or Linux Mint, aside from making their systems safer.

As for editing system configuration files: aside from pkexec, gvfs now has builtin support for admin:// paths that automatically invoke PolKit as needed. So you can open Nautilus and press Ctrl+L and type the path admin:///etc/default to open the /etc/default directory with required elevated privileges. Opening a file from there with Gedit also opens that file with required elevated privileges. From the command line you can also use the admin:// paths so you could do gedit admin:///etc/default/grub to directly open /etc/default/grub for editing with Gedit. I guess that admin:// paths should also work with Linux Mint's developed software on Linux Mint 19 but I haven't tested that yet.
How does it make it safer when I wan a script that uses sudo to run several different commands, but want it to be launchable from desktop - so first sudo is gksudo, and the rest can be just sudo, to avoid repeatedly entering the password. So how do I do this in script without a GUI wrapper for sudo. Just lucky there are alternatives - I will install one and symlink it to /usr/bin/gksudo
Jani "Sir Robin" Saksa,
Peace, Linux & Love
My website will be back (eventually)
User avatar
robsku
Level 1
Level 1
Posts: 21
Joined: Tue May 21, 2019 5:27 am
Location: Helsinki, Finland

Re: gksu removed from the repo's of Ubuntu 18.04

Post by robsku »

Cosmo. wrote: Sat Apr 21, 2018 6:36 am Why is this a problem?

With the default menu entries in Cinnamon synaptic and gparted get called via xxx-pkexec, MintUpdate simply via mintupdate. There is no gksu in game, and how should this be used at all, as the root password is empty, in Ubuntu since ever, in Mint since 18.2?
You know the root password can be set with sudo passwd, just hit enter if it asks for the old password - the write the new password, which it will ask twice. I do this always, and in my /etc/sudoers I have a line that states that, unless exception to this rule exists, sudo will ask root password, or password of the user the command is being asked as.
Jani "Sir Robin" Saksa,
Peace, Linux & Love
My website will be back (eventually)
User avatar
Moem
Level 22
Level 22
Posts: 16233
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: gksu removed from the repo's of Ubuntu 18.04

Post by Moem »

robsku, welcome to the forum... just to let you know, some of the messages you are replying to are pretty old and some of the people who posted them are no longer around.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
User avatar
majpooper
Level 8
Level 8
Posts: 2087
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: gksu removed from the repo's of Ubuntu 18.04

Post by majpooper »

robsku wrote: Sat Dec 14, 2019 11:12 am What, this is not good!
I wan't GUI sudo equivalent, not GUI su.
I want my GUI sudo wrapper back!

Oh well, there are alternatives to GUI sudo.
Well I got gksu back -
Download it here:

Code: Select all

https://pkgs.org/download/gksu
You should be aware that these .deb packes are based on Ubuntu 16.04 or Debian 9.
LM 19.x as you are aware is based on Ubuntu 18.04 and LMDE 3 is based on Debian 10. So if installing a .deb package designed for 16.04 is a concern I would understand. Just for the record though I have been running gksu on 19.x and LMDE 3 with no issues for months.

If you do go this route you will find when you first try to install the gksu .deb package it will fail and you will see a banner informing you that a dependency is missing. You will have to install the dependency first. There are two or three dependencies required to be installed before the gksu .deb will install. The dependencies .deb packages are available at the same location linked above.
User avatar
lewtwo
Level 4
Level 4
Posts: 254
Joined: Wed Oct 29, 2014 8:33 pm
Location: Houston, Texas

Re: gksu removed from the repo's of Ubuntu 18.04

Post by lewtwo »

majpooper wrote: Sat Dec 14, 2019 1:53 pm
Download it here:

Code: Select all

https://pkgs.org/download/gksu
Thank Thee :D :) :wink:
"Engineering is the art of planning and forethought."
http://www.keywild.com
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: gksu removed from the repo's of Ubuntu 18.04

Post by altair4 »

This issue is going to get far less attention now that Ubuntu changed how sudo works. sudo no longer keeps the home environment of the user that invokes it. It changes it to root like all the other branches of Linux.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
lewtwo
Level 4
Level 4
Posts: 254
Joined: Wed Oct 29, 2014 8:33 pm
Location: Houston, Texas

Re: gksu removed from the repo's of Ubuntu 18.04

Post by lewtwo »

altair4 wrote: Sat Dec 14, 2019 2:41 pm This issue is going to get far less attention now that Ubuntu changed how sudo works. sudo no longer keeps the home environment of the user that invokes it. It changes it to root like all the other branches of Linux.
Pray tell in what version?
I am running Linux Mint Mate 19.2

Code: Select all

$ echo $HOME
/home/lewis
$ sudo echo $HOME
[sudo] password for lewis:        
/home/lewis
$ 
"Engineering is the art of planning and forethought."
http://www.keywild.com
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: gksu removed from the repo's of Ubuntu 18.04

Post by altair4 »

Ubuntu 18.04 ~~ Mint 19
altair@ub1804:~$ printenv | grep HOME
HOME=/home/altair
altair@ub1804:~$ sudo printenv | grep HOME
[sudo] password for altair:
HOME=/home/altair
Ubuntu 20.04:
tester@vub2004beta:~$ printenv | grep HOME
HOME=/home/tester
tester@vub2004beta:~$ sudo printenv | grep HOME
[sudo] password for tester:
HOME=/root
Actually I think this happened with the 19.10 release. I never got the memo on this but I noticed it while doing something else in 20.04. So it will basically default to the -H option to make sure it runs with HOME of the user being invoked ( root in this case ) not the user doing the invoking.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
robsku
Level 1
Level 1
Posts: 21
Joined: Tue May 21, 2019 5:27 am
Location: Helsinki, Finland

Re: gksu removed from the repo's of Ubuntu 18.04

Post by robsku »

altair4 wrote: Sat Apr 21, 2018 10:12 am We don't need no stinkin' gksu.

We Linux desktop users have an understandable feeling of superiority over those poor Windows and macOS users. You can't feel superior if you are part of the majority. Removing gksu and making all of those HowTo's out there that specify it's use useless is just a way to remove the wheat from the chaff.
What are you on? I'm having hard time believing you're not a troll. Next phase, remove sudo and su?

Sudo is a highly configurable system - it's different from pkexec, as I understand that with pkexec the program will not run as root, unlike with sudo or su which execute as root, or as another defined user. I have a very complex /etc/sudoers, with many users, user groups, commands that ask no password, ask the users password and those that ask for root password - I also have complicated command definitions, where for example running a command with certain parameters (using GLOB's for filename parameters) asks users password, but the same command with different parameters is asking for root's password (and the timeout is considerably shorter), etc.

It's a super tool - and if you're against gksudo, lxsudo and other graphical wrappers, then you're against sudo itself too. Heck, maybe you're even against su - which is crazy.
In your face Windows.
Linux and Unix has always had a gazillion ways to achieve one thing. Well, Perl has even more, but then again how many use it outside *nix-like systems? Some, sure, just like there are Python programs with installer that installs the runtime, so the user doesn't have to install Python separately, so have there been several Perl applications doing the same. In fact, for Windows, there is a product called ActivePerl, which let's you package your Perl-application in Windows installer (.MSI I think, though it might be an .EXE as well - but why?

The fact that we have su and sudo, and GUI wrappers for them, like lxsudo, after the distro defaulted to pkexec is a richness - and I can't understand why they didn't ship gksu-package pre-installed with the distro, what I can't fathom is why on earth did they have to remove the package from repositories? And yet there are many other su/sudo wrappers available, like said lxsudo. So WHAT'S THE POINT!?

It broke many of my scripts and made me search for a solution for some time, without no benefit (and one thing you expect with Linux is that such change won't break a huge load of scripts and even applications) - until I first found pkexec, but I had no luck with couple scripts that called sudo or gksudo (depending if it was ran from terminal) several times - because normally it would ask the password after the first (gk)sudo, then execute the rest without problem. Now replacing them with pkexec made it ask at every line where a command was run with pkexec - now how good progress was that?
My problem finally was solved when I installed lxsudo - I was going to replace pkexec with that in my script(s), but the I realized that I just copied the old script back (the rest I hadn't modified yet) and made a symlink like this (in /usr/bin):

Code: Select all

robsku@dragon:/usr/bin$ sudo ln -s gksudo lxsudo
What this removal of gksu-package is, it's what Windows does. They replace a working solution with another, even if they would work fine together - it's a wonder that they didn't kill cmd.exe when they introduced PowerShell - Not Linux. Besides Linux has always had several different subsystems, like SVGAlib, FB, DirectFB and X11/X.org and now Wayland (which still has X support). Like when they switched from OSS (Open Sound System 3) to ALSA (Advanced Linux Sound Architecture), did they ditch OSS support? Nope, though first you had to configure virtual OSS device by hand and direct it's output to primary ALSA output. Funny thing, I created also virtual ALSA output, directed the v-OSS to that and directed that ALSA output to Jack Audio Daemon (I was building a system for creating music) and selected the second, real hardware output of ALSA as output for JACK.
I hope one day someone will include OSS4 (used by BSD, has better driver support and features, plus it's easier to program than the damn ALSA, which is pain in butt unless you're using a library with abstraction or PulseAudio) as alternative to ALSA. Like ALSA had OSS3 emulation so does OSS4 have ALSA virtual emulation, or so I've heard. Of course one should be able to choose either one, or even both if one has more than one sound cards - there are some drivers for ALSA that aren't available for OSS4 - then again, why not port them then?

What does it bother you to have both? Have you ever done serious work with sudo, or is it just something that pop's out now and then to ask your password?
EDIT: Some moderator keeps changing the last sentence of my post. I keep restoring it. Rather than this deteriorate into a I know what you are but what am I kind of thing they deleted it entirely. That was probably best since the modification by the moderator wasn't the least bit funny.
I'm interested, but judging from your attitude (except for In your face Windows, which it deserves, no matter how ill placed it was.

P.S. You are not majority, neither are MacOS users, but it's really sad if you thin you're feeling "superior" because of that. I feel superior because I know my way around computers, which is the reason I use Linux (and some other systems, but never Windows, unless I have to at work or it's running in a Virtual Machine and I got the license for free). See, I use Linux because that's what HC computer freaks do - and not necessarily Linux. Some use BSD, some other systems, some even what's ready on GNU. Now, BSD is a minority if anything - are they superior to you? Are Gentoo users? Because according to you they should.
Jani "Sir Robin" Saksa,
Peace, Linux & Love
My website will be back (eventually)
User avatar
lewtwo
Level 4
Level 4
Posts: 254
Joined: Wed Oct 29, 2014 8:33 pm
Location: Houston, Texas

Re: gksu removed from the repo's of Ubuntu 18.04

Post by lewtwo »

robsku wrote: Sun Dec 15, 2019 6:23 pm
altair4 wrote: Sat Apr 21, 2018 10:12 am We don't need no stinkin' gksu.
We Linux desktop users have an understandable...
Speaking of trolls, the post that you are responding to is over a year and half old.
"Engineering is the art of planning and forethought."
http://www.keywild.com
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: gksu removed from the repo's of Ubuntu 18.04

Post by smurphos »

robsku wrote: Sat Dec 14, 2019 12:17 pm Still, what would I use to replace gksudo? I mean, I have a script that is meant to be driven from GUI, and it uses gksudo to provide GUI window for asking password, then for the rest of the commands needing root priviledges it uses plain sudo, because the sudo permissions should remain for some time without needing to ask again.
For this use case just use sudo's ASKPASS feature.

e.g. have this little script somewhere

Code: Select all

#!/bin/bash
zenity --password --title="Authenticate"
Then in your script

Code: Select all

 export SUDO_ASKPASS="/path/to/your/zenity_askpass_script"
  sudo -A whatever_the_command_is
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: gksu removed from the repo's of Ubuntu 18.04

Post by smurphos »

altair4 wrote: Sat Dec 14, 2019 3:12 pm Ubuntu 18.04 ~~ Mint 19
altair@ub1804:~$ printenv | grep HOME
HOME=/home/altair
altair@ub1804:~$ sudo printenv | grep HOME
[sudo] password for altair:
HOME=/home/altair
Ubuntu 20.04:
tester@vub2004beta:~$ printenv | grep HOME
HOME=/home/tester
tester@vub2004beta:~$ sudo printenv | grep HOME
[sudo] password for tester:
HOME=/root
Actually I think this happened with the 19.10 release. I never got the memo on this but I noticed it while doing something else in 20.04. So it will basically default to the -H option to make sure it runs with HOME of the user being invoked ( root in this case ) not the user doing the invoking.
This is interesting. The memo is here - https://launchpad.net/ubuntu/+source/su ... 7-1ubuntu2
Related bug report is here - https://bugs.launchpad.net/ubuntu/+sour ... ug/1556302

I didn't realise that the behaviour to preserve the calling users $HOME was an Ubuntu added patch. Removing it clearly has advantages in pretty much eliminating the scope for inadvertently changing ownership of files in the invoking users $HOME, which can only be a good thing. I'm trying to think of use cases that might get broken by this.

I do wonder how many people on Mint 20.x will blindly run a commonly recommended command on the forum to fix home ownership issues sudo chown -Rc $USER:$USER $HOME and break root's ownership... :roll: :mrgreen:
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
karlchen
Level 23
Level 23
Posts: 18227
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: gksu removed from the repo's of Ubuntu 18.04

Post by karlchen »

smurphos wrote: Mon Dec 16, 2019 1:11 amI do wonder how many people on Mint 20.x will blindly run a commonly recommended command on the forum to fix home ownership issues sudo chown -Rc $USER:$USER $HOME and break root's ownership... :roll: :mrgreen:
I found myself more than once doing this in my terminal window: sudo echo chown -Rc $USER:$USER $HOME when coming across commandlines like the one above in forum posts, because I was not sure what precisely the variables would be expanded to at runtime. :wink:
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
Locked

Return to “Chat about Linux”