This seems odd to me. I can't install software using the "friendly" GUI tool unless I input the root password but by default, my Ubuntu 12.04 has root disabled with no password set.

Why doesn't Software Centre use a SUDO credential? Perhaps using gksudo?

  • 1
    It asks for your user password not for root's, root does have no password. – Uri Herrera Jun 27 '12 at 22:09
  • Software Centre does normally use sudo type requests before any software install. *Have you modified your setup or root user is some way? – david6 Jun 28 '12 at 5:00
  • AFAIK only to allow my normal ID to SUDO without a password – Julian Knight Jun 28 '12 at 7:16
  • I started having the exact same problem. I can use sudo from the cli just fine, but when running Ubuntu Software Update, it's asking me for root password. – rcourtna Jan 17 '13 at 3:41
  • I never did find a proper answer to WHY it was doing this I'm afraid. I simply put a password on root and it worked OK. – Julian Knight Jan 18 '13 at 21:45

This happens (at least on 14.04 which I've just tested on) when there are no users in the "sudo" group.

It doesn't matter if your user is explicitly listed in the /etc/sudoers file or not as to this behaviour -- it looks for members of the sudo group and requests a password for one of those users. If there are no members in that group then it requests the root password, which may not be enabled at all.

Edit: This is probably because the sudoers file is unreadable by normal users, but the list of members in the sudo group *is* possible to access.

  • Ah, good call David. Seems as good an answer as any so you may as well get the points! – Julian Knight Nov 20 '14 at 23:54
  • In my case, my user is a member of the sudo group, I have added %sudo ALL=(ALL) NOPASSWD:ALL to /etc/sudoers, so that no password is requested for the members of the sudo group, I am able to run sudo commands on the terminal without a password being asked, and still Ubuntu Software Center is asking me for my password (the current logged-in user's password, not root's) to install/upgrade software. – dangonfast Jun 25 '15 at 7:19
  • 1
    It turns out this is controlled by policykit, not by sudo/gksudo – dangonfast Jun 25 '15 at 8:11
  • @jeckyll2hide Yes, policykit looks at the sudo group and decides whether to use gksudo or gksu on the gnome desktop. It probably assumes that no-one in the sudo group is allowed to sudo without a password, hence still prompting when NOPASSWD is specified. The javascript(?) used by policykit should have the logic in for this and make it more obvious. – David Gardner Jun 25 '15 at 13:34

I have never seen Ubuntu Software Center ask for a root password. It's not supposed to, and it won't happen unless you do something special to your system. What is supposed to happen, is that it uses Policy Kit, which will ask you to select a user and enter a password for that user.

PolicyKit is much more suitable for this than gksudo, since sudo will allow access to commands, whereas PolicyKit allows access to actions such as org.debian.apt.install-or-remove-packages. If instead you provided access to run apt-get, then you could do anything apt-get can do, which is way too much power. You might, for instance, grant permission for all users to install security upgrades from official Ubuntu archives, but not allow the user to install new software. That wouldn't be possible to do with sudo.

I would check to see if you've removed the package policykit-1-gnome.

  • No, policykit-1-gnome is installed. Every time I try to install anything, it asks me for the root password. I could only install from the command line until I added a password to root. I have changed SUDO so that my normal user login isn't asked for a password when doing SUDO - would that effect it? – Julian Knight Jun 27 '12 at 22:33
  • Thanks for the info re policykit. I've mainly used Debian and SUSE in the past so I'm happy with command line installs but it bugs me why Software Centre isn't working as expected. – Julian Knight Jun 27 '12 at 22:35

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.