Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synaptic does not work on Wayland #15

Open
vanillajonathan opened this issue Mar 10, 2017 · 30 comments

Comments

@vanillajonathan
Copy link
Contributor

@vanillajonathan vanillajonathan commented Mar 10, 2017

No description provided.

@gunterkoenigsmann

This comment has been minimized.

Copy link

@gunterkoenigsmann gunterkoenigsmann commented Jun 15, 2017

The problem that causes this is that in order to improve security wayland doesn't support gui applications to run as root. The preferred way to get root access for an application is to make it run unprivilleged and to elevate the rights of a worker task using policykit, whenever needed.

@vanillajonathan vanillajonathan changed the title Synaptic not work on Wayland Synaptic does not work on Wayland Jun 15, 2017
@julian-alarcon

This comment has been minimized.

@franko108

This comment has been minimized.

Copy link

@franko108 franko108 commented Oct 31, 2017

Same problem on Debian 9 with Gnome 3.22.3, opening from a menu doesn't work, from shell is such an error:

$ synaptic-pkexec
No protocol specified
Unable to init server: Could not connect: Connection refused
(synaptic:6206): Gtk-WARNING **: cannot open display: :0

Firstly prompted for a password, and then error above.
Same situation with synaptic or synaptic-pkexec command. Launched as root or a non root, same error.

EDIT.
Actually, it happened to me after I installed proprietary ATI VGA drivers (xserver-xorg-video-ati libgl1-mesa-dri). Before that, Synaptic did work, but on the small resolution (1024x768)

@DarkFenX

This comment has been minimized.

Copy link

@DarkFenX DarkFenX commented Dec 11, 2017

Doesn't work on 1920x1080 on intel OSS drivers. I very much doubt it depends on this though.

@vanillajonathan

This comment has been minimized.

Copy link
Contributor Author

@vanillajonathan vanillajonathan commented Dec 11, 2017

@gunterkoenigsmann

This comment has been minimized.

Copy link

@gunterkoenigsmann gunterkoenigsmann commented Dec 11, 2017

Nah... ...it is simpler: Wayland tries to enhance security by making applications choose if they want root rights or access to the graphical display. Synaptic wants the first - and therefore doesn't get the latter. The only way around this is drawing the gui from a non-root process and using policykit to create a worker process that does the things root rights are needed for.

@Pjotr123

This comment has been minimized.

Copy link

@Pjotr123 Pjotr123 commented Jan 12, 2018

@gunterkoenigsmann : I understand, thanks for your explanation.... Is there any chance of us being able to use Synaptic with Wayland, at some point? For me, it's an absolutely essential tool.

@mvo5

This comment has been minimized.

Copy link
Owner

@mvo5 mvo5 commented Jan 13, 2018

Hey, thanks for the problem report. I'm aware of the issue and I'm sorry that I have not tried to fix it yet.

Unfortunately fixing this is quite a bit of work as it needs some re-architecturing of the current code. Synaptic has a "non-root" mode already but that is read-only. So to get the current behaviour this non-root mode would need a companion dbus service that runs as root and uses policykit and this would need the ability to locks the apt cache and to commit changes and send the progress (including the dpkg pty) to the non-root part of synaptic. If someone is keen to help with this effort I'm happy to guide. My own time is unfortunately limited to work on this.

@Pjotr123

This comment has been minimized.

Copy link

@Pjotr123 Pjotr123 commented Jan 13, 2018

@mvo5 : thanks for responding! Unfortunately I have no coding skills, so I hope you (or someone else) will be able to find some time to fix this....

@yareckon

This comment has been minimized.

Copy link

@yareckon yareckon commented Jan 30, 2018

Hmm, sounds like a major effort that isn't gonna happen any time soon without some help. It's not too late for Google Summer of Code for Debian: https://wiki.debian.org/SummerOfCode2018 @mvo5 would you able to participate in that as a mentor?

@franko108

This comment has been minimized.

Copy link

@franko108 franko108 commented Feb 3, 2018

On my Debian 9 (testing repo) synaptic started to work after some updates.
Synaptic version is 0.8.42, kernel 4.14.0-3-amd64,
GNOME Shell 3.22.3

@vanillajonathan

This comment has been minimized.

Copy link
Contributor Author

@vanillajonathan vanillajonathan commented Feb 5, 2018

@franko108 You mean Synaptic version 0.84.2.
http://metadata.ftp-master.debian.org/changelogs/main/s/synaptic/synaptic_0.84.2_changelog

Depend on policykit-1 instead of recommending
gksu|kdebase-bin|policykit-1. data/synaptic.desktop.in and
debian/synaptic.menu both use debian/synaptic-pkexec, which
unconditionally runs pkexec. (Closes: #856520)

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856520

@franko108

This comment has been minimized.

Copy link

@franko108 franko108 commented Feb 5, 2018

@vanillajonathan
yes, Synaptic version is 0.8.42.
If you need some more information about my setup/dependencies, let me know.

@geki-yaba

This comment has been minimized.

Copy link

@geki-yaba geki-yaba commented Apr 7, 2019

Unfortunately fixing this is quite a bit of work as it needs some re-architecturing of the current code. Synaptic has a "non-root" mode already but that is read-only. So to get the current behaviour this non-root mode would need a companion dbus service that runs as root and uses policykit and this would need the ability to locks the apt cache and to commit changes and send the progress (including the dpkg pty) to the non-root part of synaptic. If someone is keen to help with this effort I'm happy to guide. My own time is unfortunately limited to work on this.

Well, just a dumb idea, but before you do the dbus service from scratch, I'd recommend packagekit with aptcc as backend and libpackagekit gobject library as frontend. I wonder, if a dpkg pty is still necessary with that? Though, I just don't know.

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

@AsciiWolf AsciiWolf commented Jul 7, 2019

Debian Buster was released today with Wayland as default, but Synaptic unfortunately still does not work on Wayland.

@vanillajonathan

This comment has been minimized.

Copy link
Contributor Author

@vanillajonathan vanillajonathan commented Jul 7, 2019

Here is a temporary workaround:

Create a file named "sugo" with this content:

#!/bin/sh

[ -n "$@" ] || exit 0
xhost si:localuser:root
sudo $@
xhost -si:localuser:root

Give it permission to execute (chmod +x sugo). Now you can run ./sugo synaptic to start Synaptic.

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

@AsciiWolf AsciiWolf commented Jul 7, 2019

Thanks. I really hope this issue will get properly fixed in a future release.

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

@AsciiWolf AsciiWolf commented Jul 8, 2019

@mvo5 Just an idea: Couldn't this be solved by creating a specific polkit policy for Synaptic? I think some applications use this on Wayland to run as root and it works.

@gunterkoenigsmann

This comment has been minimized.

Copy link

@gunterkoenigsmann gunterkoenigsmann commented Jul 8, 2019

The graphical user interface of these applications doesn't run as root (at least the ones that don't use Xwayland in order to defeat all security). But they can use polkit and dbus to order a backend to do things as root.

Synaptic could use already-existing services by telling dbus to tell packagekit to install or uninstall packages...

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

@AsciiWolf AsciiWolf commented Jul 8, 2019

I am not sure if using PackageKit is a good idea. As far as i know, PackageKit is deprecated.

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

@AsciiWolf AsciiWolf commented Aug 20, 2019

This could help.

@dupondje

This comment has been minimized.

Copy link

@dupondje dupondje commented Sep 17, 2019

Since Gnome/Mutter 3.34, Wayland can run X11 software with root permissions. No need for specific workarounds anymore.
pkexec synaptic just works fine on Ubuntu 19.10 for example now.

But we need to revert/fix 5f3151b#diff-6e0cf79e03f9bdebf99dc9f3759f0950
As since 3.34 its contra productive now :)

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

@AsciiWolf AsciiWolf commented Oct 12, 2019

GNOME 3.34 is now in Debian Testing and will be in Ubuntu 20.04. @mvo5 Please, consider reverting 5f3151b.

@jbicha

This comment has been minimized.

Copy link
Contributor

@jbicha jbicha commented Oct 12, 2019

@mvo5 Ping! Ubuntu 19.10 will be released in less than a week

@mvo5

This comment has been minimized.

Copy link
Owner

@mvo5 mvo5 commented Oct 13, 2019

@jbicha Do we have all the required bits in 19.10 for synaptic to work under wayland?

@mvo5

This comment has been minimized.

Copy link
Owner

@mvo5 mvo5 commented Oct 13, 2019

@jbicha, @AsciiWolf Thanks for the reminder and sorry for my slow reaction. I reverted the patch and uploaded an updated version to both debian and ubuntu.

@vanillajonathan

This comment has been minimized.

Copy link
Contributor Author

@vanillajonathan vanillajonathan commented Oct 13, 2019

I guess this issue could be considered kind of resolved. Which would bring us to the next issue, that Synaptic still relies on X, hence requires XWayland. Also, not sure it works on any other Wayland environment other than GNOME.

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

@AsciiWolf AsciiWolf commented Oct 29, 2019

I see that this issue was most likely fixed in 0.84.7. Thanks! :-)

@Isakku

This comment has been minimized.

Copy link

@Isakku Isakku commented Nov 21, 2019

I consider Synaptic package manager critical for my usage of debian based distros (Ubuntu, Mint, etc.) If Mint 20 would come with Wayland as some people are asking for, I really hope there will be no problems whatsoever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.