I'd like Software Center, Update Manager and some other system management applications to work without asking for password (like sudo does if configured with NOPASSWD) but only asking for a confirmation instead, or even without any confirmation. At the same time I wouldn't like to use no user password at all. Is this reachable?
Ubuntu Software Center authorization uses policy kit. When requested for the authentication during the remove action you can expand the "Details" pointer to see the action that is being invoked. It's org.debian.apt.install-or-remove-packages . You can change the corresponding policy to not request for authentication:
Edit
/usr/share/polkit-1/actions/org.debian.apt.policy
, search fororg.debian.apt.install-or-remove-packages
, then find for thedefaults
section, replaceauth_admin
andauth_admin_keep
withyes
.Adding to joão-pinto's answer, since software center now uses snapcraft's policies, the file to be modified should be this one:
/usr/share/polkit-1/actions/io.snapcraft.snapd.policy
look for the policy with id
io.snapcraft.snapd.manage
and change all entries under defaults toyes
.You should have this:
Tested on Ubuntu 20.04.1 LTS
Towards a more generic solution
Since the policies/actions can change from version to version (there are two other answers mentioning two other different files), the best way to handle this is:
/var/log/auth.log
After installing a package, the entries in
/var/log/auth.log
were these:I've searched and found the file where the action is:
Using this information, on my Ubuntu 20.04.2 LTS, I edit the following file:
/usr/share/polkit-1/actions/org.freedesktop.packagekit.policy
.The I've changed the
<defaults>
on action:<action id="org.freedesktop.packagekit.package-install">
to:Just put in
/etc/sudoers
all this and it will workThese methods with NOPASSWD: ALL seem to result in no password being asked. this is not what I want. I want to be asked the ROOT password.
Seems the right hint was to add "Defaults rootpw" to sudoers. At least Synaptic now starts after receiving the root password. Nice. I can use Ubuntu the Debian way :)
Note:- Disabling password prompts might be a security risk
Open the terminal window from Applications --> accessories --> terminal, run the command:
Find the line that says
and change it to
Save and exit the file