Debian – Why Sudo is Not Installed by Default

debiansudo

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                            

Best Answer

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

Related Question