Page 1 of 1

Problem with Synaptic and Obmenu

Posted: 2018-02-26 14:47
by fvs
Can't open synaptic or obmenu in terminal with sudo or root?
Can'tfrank@debian:~$ sudo synaptic
No protocol specified
Unable to init server: Could not connect: Connection refused

(synaptic:1062): Gtk-WARNING **: cannot open display: :0

Re: Problem with Synaptic and Obmenu

Posted: 2018-02-26 16:40
by Bulkley
Obmenu shouldn't need root. For Synaptic, use su and when prompted enter your root password. I have this in my Openbox menu:

Code: Select all

gksu -g /usr/sbin/synaptic

The gksu is a box for entering root password.

Re: Problem with Synaptic and Obmenu

Posted: 2018-02-26 18:36
by Head_on_a_Stick
^ I think gksu is being phased out in favour of pkexec.

The synaptic.desktop file calls

Code: Select all

synaptic-pkexec
which is a wrapper for

Code: Select all

pkexec synaptic
EDIT: obmenu should not be run as root because it will save the configuration file in /root and won't change your desktop.

Re: Problem with Synaptic and Obmenu

Posted: 2018-02-26 20:33
by Bulkley
Head_on_a_Stick wrote:I think gksu is being phased out in favour of pkexec.
That's interesting. My gksu is working for now but I'll take a look at pkexec.

I often wish that sudo had not been invented. It has its uses but it is badly abused, especially by newbies.

Re: Problem with Synaptic and Obmenu

Posted: 2018-02-26 20:46
by Head_on_a_Stick
Bulkley wrote:My gksu is working for now
Yes, it should still work for the foreseeable future.

The problem is that gksu allows the application too many privileges and pkexec is supposed to address this but it does require a special exception file in /usr/share/polkit-1/actions/ (which is supplied by the synaptic package) so it won't work for everything.
Bulkley wrote:I often wish that sudo had not been invented. It has its uses but it is badly abused, especially by newbies.
+1

OpenBSD has demoted sudo to the ports tree and moved to doas(1) instead, it's a _much_ cleaner solution :cool:

Re: Problem with Synaptic and Obmenu

Posted: 2018-02-26 20:57
by Head_on_a_Stick
fvs wrote:

Code: Select all

Unable to init server: Could not connect: Connection refused
Just for the record, this will let you start synaptic with sudo:

Code: Select all

xhost +local:
Don't do it though, it is fundamentally insecure.