51

I was reading a guide to install some software and came reading until this shocking statement:

sudo is not installed on Debian by default. Make sure your system is up-to-date and install it.

As current Debian user, this is difficult to believe since from installation I'm able to use sudo. So, maybe it got installed when I selected not to create a password for the root account (rendering the root account disabled) or something is amiss here. Does Debian not include sudo (or it's variants) as installed by default?

If we go by what the other answer says, sudo can be installed due APT/DPKG dependencies, which in some cases will ask tasksel/apt to install those too, but isn't included in the required or important list:

➜  ~  aptitude search ~prequired | grep sudo
➜  ~  aptitude search ~pimportant | grep sudo
➜  ~  aptitude why '~prequired' sudo      
i A dpkg     Suggests   apt                             
i A apt      Suggests   aptitude | synaptic | wajig     
i A synaptic Recommends gksu | kdebase-bin | policykit-1
i A gksu     Depends    sudo                            
➜  ~  aptitude why '~pimportant' sudo           
i A apt      Suggests   aptitude | synaptic | wajig     
i A synaptic Recommends gksu | kdebase-bin | policykit-1
i A gksu     Depends    sudo                            
  • 2
    Keep in mind that even if sudo is not installed, you can still use the su command. – Pikamander2 Nov 30 '15 at 10:24
64

This is a side-effect of installation parameters. If you specify a root password during installation sudo is not installed by default. If you do not specify a root password, sudo is installed. The authoritative source for this quoted below. Another related special case is that during install if you specify the sudo-ldap package, sudo will not be installed. This is the only time that sudo-ldap can be installed without a root password. If you wish to upgrade from sudo to sudo-ldap latter, you must have a root password during the upgrade.

If you do not specify a password for the root user this account will be disabled but the sudo package will be installed later to enable administrative tasks to be carried out on the new system. -- from debian-installer/manual/en/howto/installation-howto.xml

  • 1
    or you could chroot from a live cd and do the upgrade. or sudo -i. – strugee Dec 30 '13 at 21:23
  • 4
    Nope, dosn't work. When apt tries to install sudo-ldap or upgrade sudo to sudo-ldap, becouse sudo and sudo-ldap conflict it first uninstalls sudo before installing sudo-ldap and sudo's uninstall scripts fail unless a root password is defined. This is not hard to get around, just make sure root has a password while doing this, and then remove it. – hildred Dec 30 '13 at 21:31
  • 1
    Here is a nice guide to adding SUDO: privateinternetaccess.com/forum/discussion/18063/… – raider33 Apr 15 '16 at 12:53
  • Installation Guide link where this is mentioned: debian.org/releases/jessie/amd64/apas03.html.en – CrazyPenguin Aug 24 '16 at 2:29
  • The setup is performed by user-setup-ask and user-setup-apply in user-setup. – Stephen Kitt Feb 28 '17 at 9:05

protected by Community Nov 30 '15 at 10:24

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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