Is that possible ?

Thanks

  • @[email protected]
    link
    fedilink
    8
    edit-2
    5 months ago

    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

    • @[email protected]
      cake
      OP
      link
      fedilink
      25 months ago

      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

      • @[email protected]
        link
        fedilink
        1
        edit-2
        5 months ago

        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.

          • @[email protected]
            link
            fedilink
            2
            edit-2
            5 months ago

            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

  • @[email protected]
    link
    fedilink
    English
    25 months ago

    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

      • @[email protected]
        link
        fedilink
        English
        25 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.

  • @[email protected]
    link
    fedilink
    English
    -25 months ago

    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

    • @[email protected]
      link
      fedilink
      65 months ago

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