I have setup sudoers to allow users to install software already in the repos, but I’d like to allow them to do so in Gnome Software as well. I have tried to edit /usr/share/polkit-1/rules.d/org.freedesktop.packagekit.rules to add a rule there, but it didn’t change anything. It still falls back to prompting for the admin user’s password. Any idea how I can do this? I am aware of the security issues with this, but please, let me be the judge of this
You found the right file to edit. Did you restart PackageKit after modifying it? If you have it immediately return polkit.Result.YES then it will probably work and then you can tighten the permissions from there.
(And of course you would want to copy the file to /etc rather than modifying packaged files under /usr.)
Feb 27 15:25:28 myhostname polkitd(authority=local)[64507]: Operator of unix-session:2 FAILED to authenticate to gain authorization for action org.freedesktop.packagekit.package-install for system-bus-name::1.86 [/usr/bin/gnome-software --gapplication-service] (owned by unix-user:myuser)
Oh, the problem is you’re using Debian (or Ubuntu or another Debian-based system). The pkla support was removed from polkit roughly a decade ago, so a pkla file won’t do anything at all in upstream GNOME. But Debian has just decided to stick with a very old version of polkit that uses pkla instead of JavaScript configuration. Sorry that I forgot about this or it would have been one of my first suggestions to you.