What is the -y flag in the `apt install` command?

Am I missing something?

When you invoke apt install … the command is apt, not install. man install will show you the manual for install which is a different command. The right place to start is man apt.

Some commands in a form foo bar anything … may have manuals available under man foo-bar. E.g. man btrfs-subvolume runs well, but btfrs-subvolume (as a command) doesn't exist, the syntax is btrfs subvolume ….

This is not the case with apt though; in my Debian there is no man apt-install. Yet man apt says install (apt-get(8)) where it explains apt install, so now we know we should read

man 8 apt-get

And this is it, -y is explained there:

-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. […].


-y means yes to everything.

If you're absolutely sure its something you want to do, or are scripting apt, its a good idea. In situations where you're pulling in additional packages as dependancies, for example, apt will check if you're sure, and in some cases you just want it to go ahead and not bother asking for permission.