How do you stop all interactive prompts from apt-get when installing or upgrading packages?

I'm trying to write a non-interactive script to install packages on servers, whenever an upgrade requires installing a new kernel, apt-get always ignores the -y option and prompts me on what option to take to update grub.lst. I always want to install the package maintainer's version. How do I disable this prompt?

1 Answer 1


You need to specify that you want to use the non-interactive frontend:

DEBIAN_FRONTEND=noninteractive apt-get -y install ...

With sudo:

sudo DEBIAN_FRONTEND=noninteractive apt-get -y install ...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .