Fixes an issue when being run as root

When we are already root, the SUDO variable needs to be set to the empty
string.

Added a mnemonic for 'dpkg --configure -a'.
 Removed redundant id -u and bugfixed the other call