Tip: –assume-yes option in apt-get

If you are sure of what you are downloading then use -y with apt-get to bypass interactions.
From the man pages:

-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.