Ubuntu – How to install a package with apt without the “Do you want to continue [Y/n]?” prompt

aptsoftware installation

Of course when you type:

sudo apt-get install whatever

It asks you:

Do you want to continue [Y/n]? 

Is there any way I can just install it without it asking me if I want to continue? I don't really care about space, I have more then enough.

Best Answer

sudo apt-get install -y whatever

From the man page (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.