Screenshot below. In a base install of debian, sudo isn't installed by default. This causes certain commands to fail within the installer. That said, looking at the script, if it's running as root then it really doesn't need sudo in the first place.
Perhaps something like this toward the beginning of the script might help:
Code:
SUDO="$(type -p sudo)"
if [[ -z $SUDO && "$(id -u)" != "0" ]]; then
echo "Error: sudo not found. Either install sudo or run as root." 2>&1
exit 1
fi
...and then just use "$SUDO" in place of sudo.