Allow Non-Admin Users to Install Software

Many Ubuntu users would like the ability to be able to add and remove applications on their machine but are not knowledgeable enough to be safely trusted with full administrative (root) user rights. A good example of this type of operation is Google Play on Android. This is where PolicyKit fits in on Linux. It allows the behaviour of each right requested by the user to be modified. In this article we show how to allow non-root users to install software via Software Centre.

Should work in all Ubuntu releases. Tested from 12.04 (Precise Pangolin) on Ubuntu Desktop editions.

None, as PolicyKit will already be installed! :-)

Log on and become root:

sudo -s

Create the file /etc/polkit-1/localauthority/50-local.d/10-allow-user-installs.pkla and add the following to it:

[Untrusted Install]
Identity=unix-user:*
Action=org.debian.apt.install-or-remove-packages;org.debian.apt.upgrade-packages
ResultyAny=no
ResultInactive=no
ResultActive=auth_self

[Untrusted Update]
Identity=unix-user:*
Action=org.debian.apt.update-cache
ResultAny=no
ResultInactive=no
ResultActive=yes

Once saved, the policy should become immediately effective from the next policy request.

The unix-user:* can be replaced by a specific user account name or even the unix-group: prefix for a group. For example, unix-user:usera;unix-group:groupb would allow all users in the group groupb plus usera to install software.