use apt-get -y instead of apt-get.