def _setup_apt_automation():
    """Setup the environment to be fully automated for tricky installs.

    Sun Java license acceptance:
    http://www.davidpashley.com/blog/debian/java-license

    MySQL root password questions; install with empty root password:
    http://snowulf.com/archives/540-Truly-non-interactive-unattended-apt-get-install.html

    Postfix, setup for no configuration. See more on issues here:
    http://www.uluga.ubuntuforums.org/showthread.php?p=9120196
    """
    interactive_cmd = "export DEBIAN_FRONTEND=noninteractive"
    if not env.safe_contains(env.shell_config, interactive_cmd):
        env.safe_append(env.shell_config, interactive_cmd)
    # Remove interactive checks in .bashrc which prevent
    # bash customizations
    env.safe_comment(env.shell_config, "^[ ]+\*\) return;;$")
    package_info = [
            "postfix postfix/not_configured boolean true",
            "postfix postfix/main_mailer_type select 'No configuration'",
            "mysql-server-5.1 mysql-server/root_password string '(password omitted)'",
            "mysql-server-5.1 mysql-server/root_password_again string '(password omitted)'",
            "mysql-server-5.5 mysql-server/root_password string '(password omitted)'",
            "mysql-server-5.5 mysql-server/root_password_again string '(password omitted)'",
            "sun-java6-jdk shared/accepted-sun-dlj-v1-1 select true",
            "sun-java6-jre shared/accepted-sun-dlj-v1-1 select true",
            "sun-java6-bin shared/accepted-sun-dlj-v1-1 select true",
            "grub-pc grub2/linux_cmdline string ''",
            "grub-pc grub-pc/install_devices_empty boolean true",
            "acroread acroread/default-viewer boolean false",
            "rabbitmq-server rabbitmq-server/upgrade_previous note",
            "condor condor/wantdebconf boolean false",
            "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula boolean true",
            "ttf-mscorefonts-installer msttcorefonts/present-mscorefonts-eula note",
            "gdm shared/default-x-display-manager select gdm",
            "lightdm shared/default-x-display-manager select gdm",
            "postfix postfix/mailname string notusedexample.org",
            # Work harder to avoid gdm dialogs
            # https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/1020770
            "debconf debconf/priority select critical"
            ]
    package_info = env.flavor.rewrite_apt_automation(package_info)
    cmd = ""
    for l in package_info:
        cmd += l % 'echo "%s" | /usr/bin/debconf-set-selections;'
    env.safe_sudo(cmd)
dataset/ETHPy150Open chapmanb/cloudbiolinux/cloudbio/package/deb.py/_setup_apt_automation/swapped operands of `%`