Linux – the -y flag in the `apt install` command

aptcommand linelinux

I'm seeing the -y flag being used in apt install -y a lot today but when I do man install no -y flag is described.

Am I missing something?

Best Answer

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

Related Question