this post was submitted on 06 Jun 2024
13 points (88.2% liked)

KDE

5375 readers
130 users here now

KDE is an international technology team creating user-friendly free and open source software for desktop and portable computing. KDE’s software runs on GNU/Linux, BSD and other operating systems, including Windows.

Plasma 6 Bugs

If you encounter a bug, proceed to https://bugs.kde.org, check whether it has been reported.

If it hasn't, report it yourself.

PLEASE THINK CAREFULLY BEFORE POSTING HERE.

Developers do not look for reports on social media, so they will not see it and all it does is clutter up the feed.

founded 1 year ago
MODERATORS
 

Is that possible ?

Thanks

all 21 comments
sorted by: hot top controversial new old
[–] boredsquirrel@slrpnk.net 8 points 5 months ago* (last edited 5 months ago) (1 children)

Without telling your distro this question is not helpful.

Discover uses packagekit, an abstraction layer that can do things like install, update, remove on many different distros.

So this might be distro-independent, but maybe not.

Try to enter in the terminal pkcon upgrade and if a GUI password prompt pops up, click on "expand" and see the action that is used like org.somenama.packagekit_update

This GUI prompt might also already be the one you described

https://github.com/boredsquirrel/Linux/tree/main/polkit

[–] KaKi87@jlai.lu 2 points 5 months ago (1 children)

Sorry I thought that Discover was only used on KDE neon, which thefore is the distro, and the CLI equivalent is indeed the one you mentioned.

So what's the solution for this distro ?

Thanks

[–] boredsquirrel@slrpnk.net 1 points 5 months ago* (last edited 5 months ago) (2 children)

I used Neon for a while. Again, can you please give the needed information. If the password dialog shows, at the left click on "expand"/"show more" and you see the exact action that is executed.

Then have a look at the rules in my linked repo, and replace the action in "libvirt" with that, and the group with "wheel"

(Use groups and send me the output, no idea if the sudo users are in the sudo group on Ubuntu)

Then send that rule, embed it in

``` Rule ```

To format correctly. I look at it and if it is correct, we go on.

[–] KaKi87@jlai.lu 2 points 5 months ago (1 children)

org.freedesktop.packagekit.system-update

Thanks

[–] boredsquirrel@slrpnk.net 1 points 5 months ago

That was only one of the requested info. But I edited the rule.

[–] minecraftchest1@social.opendesktop.org 1 points 5 months ago (1 children)

@boredsquirrel
You need to create a polkit rule that allows authentication without password. I will see if I can send an example your way sometime this comming week.
@KaKi87

[–] boredsquirrel@slrpnk.net 2 points 5 months ago* (last edited 5 months ago) (1 children)

I have examples in the repo I linked

polkit.addRule(function(action, subject) {
  if action.id == "org.freedesktop.packagekit.system-update" {
    if subject.isInGroup("wheel") {
      return polkit.Result.YES;
    }
  }
});

Please ask KDE Neon devs, if placing this rule as /etc/polkit-1/rules.d/packagekit-update.rules is safe

[–] KaKi87@jlai.lu 1 points 5 months ago (2 children)

I don't have a rules.d directory at /etc/polkit-1/ though, I only have localauthority and localauthority.conf.d.

Should I create the directory then create the file ?

Thanks

[–] boredsquirrel@slrpnk.net 1 points 5 months ago

Please ask KDE Neon devs.

Discuss.kde.org

Or file a bug on bugs.kde.org

[–] Zamundaaa@discuss.tchncs.de 2 points 5 months ago (1 children)

Yes, and many distros have a polkit rule set up to allow installing or updating without a password. You can likely just copy it from Fedora or sth

[–] KaKi87@jlai.lu 1 points 5 months ago (1 children)

Could you please elaborate on that ? Thanks

[–] Zamundaaa@discuss.tchncs.de 2 points 5 months ago

Fedora just has

polkit.addRule(function(action, subject) {
    if ((action.id == "org.freedesktop.packagekit.package-install" ||
         action.id == "org.freedesktop.packagekit.package-remove") &&
        subject.active == true && subject.local == true &&
        subject.isInGroup("wheel")) {
            return polkit.Result.YES;
    }
});

in /usr/share/polkit-1/rules.d/org.freedesktop.packagekit.rules. If you put the same file in there, it should work.

[–] MajinBlayze@hexbear.net 1 points 5 months ago* (last edited 5 months ago) (1 children)

For flathub packages, you could switch to user installs instead of system. Settings, then click the up arrow next to flathub (user) (if it's configured, otherwise you'd have to add it)

It will prevent multiple users from being able to use the same installation of packages, but if you're the only user if the machine it doesn't really matter

[–] KaKi87@jlai.lu 1 points 5 months ago (1 children)

Yes but APT packages are the ones requiring the password. Thanks

[–] MajinBlayze@hexbear.net 1 points 5 months ago

Yeah, I don't think there's any getting around that. Apt package modify the system, and by nature require elevated permissions.

[–] Xeroxchasechase@lemmy.world 1 points 5 months ago (1 children)

Flatpacks usually don't require password

[–] KaKi87@jlai.lu 3 points 5 months ago

Yes but APT packages are the ones requiring the password. Thanks

[–] therealjcdenton@lemmy.zip -2 points 5 months ago (1 children)

Yes but the only way I know is to make your whole system use no password Do sudo visudo and change the line %wheel ALL=(ALL:ALL) ALL To %wheel ALL=(ALL:ALL) NOPASSWD: ALL and make sure you are in the wheel group you can check by doing groups | rg wheel If not add yourself via sudo passwd --add $USER wheel Then edit the file ~/.config/kdesurc to be [super-user-command] super-user-command=sudo

This is a massive security risk but hey windows let's you do admin stuff without a password as well

[–] boredsquirrel@slrpnk.net 6 points 5 months ago

Many Distros use polkit instead of sudo actions. Though many sudo actions dont have polkit rules.