“unable to install <package>. You do not have permission to install software”

In Software (gnome-software) I am getting “unable to install Emacs. You do not have permission to install software” (From PureOS repo). Also occurred with Timeshift.

I’m on a fresh install of Byzantium using Sway.

in terminal:

entering "groups $USER -> includes sudo

gnome-software -> launches Software

sudo gnome-software -> throws errors:
“No protocol specified
Unable to init server: Could not connect: Connection refused
Gtk cannot open display: :0”

In terminal I can install the timeshift package. When I enter “timeshift” in the terminal I get CLI output for timeshift but the GUI does not launch.

If I log into GNOME (x11) I can do the install in Software after entering my Sudo password.

I am thinking this is a Wayland issue.

Not sure what to do. Is this a bug I should file? Or, is there a quick change I could make?

Are these related?

This(1) talks of a Wayland bug and one must issue “xhost +local” in the CLI to use GUI apps as root.

This(2) indicates Wayland doesn’t allow GUIs to run as root.

This(3) talks of setting GDK_BACKEND to wayland, x11.

Any tips?

1 Got hit by Wayland's bug

2 [SOLVED] Synaptic GUI doesn't load

3 https://discourse.ubuntu.com/t/gtk-backend-selection-or-why-gtk-cannot-open-display-0/17657