de man apt-get
-y, --yes, --assume-yes
Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively. If an
undesirable situation, such as changing a held package, trying to install a unauthenticated package or
removing an essential package occurs then apt-get will abort. Configuration Item: APT::Get::Assume-Yes.
você já tentou?
editar
minha proposta para o install.sh
sudo apt-get -y update
sudo apt-get -y install default-jdk
sudo apt-get -y install expect
sudo apt-get install lftp
# rest unchanged