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?


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.