apt-get install -y <program> What is the -y option for?

Asked

Viewed 623 times

1

I don’t have much knowledge of linux and I got the following doubt when performing the installation of a new software on Ubuntu 16:

What is the -y option for the apt-get package installer?

  • Usually the option -y is not to ask if you really want to do aquilo. He assumes the answer will be yes, if you omit this you will be asked. For example: Deseja realmente instalar XX?, you will need to manually say y. The -y is sometimes ignored for security, as in cases where GPG signatures or hash do not match, so will ask if you really want to proceed, for these cases there are the --force-yes, in the apt-get, which is unsafe and not recommended.

2 answers

4


-y is by convention to automatically answer yes (yes) questions that may arise during the installation/update. Whenever you see this flag in the delegating command a particular process is very likely to be with this intention. Prevents this question from waiting for an answer, ex:

Do you want to continue? [Y/n]

And it just goes on like you said yes (Y).

In the case of apt-get, the description of the flag in man apt-get is the following:

-y, -yes, -assume-yes
Automatic yes to prompts; assumes "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.

Translation:

-y, -yes, -assume-yes
Yes automatic to prompts, assumes "yes" as an answer to all prompts (questions) and runs without interactivity. If an undesirable situation occurs, such as changing a maintained package, try to install an unauthenticated package or removing an essential package, so the process (apt-get) will be aborted.

0

I believe that the -y could be translated as "install without confirmation".

When you use it there is no need to press "S" or "Y" to confirm the installation procedure.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.