-2

I have seen commands like this:

sudo apt-get upgrade -y 

I would like to know the meaning of the -y flag and a reference for Linux command line flags in general.

Zanna
  • 70,465
soldier
  • 479
  • 1
  • 6
  • 17
  • 2
    Have you tried man apt-get (ie. ask your system to show you the reference MANual page for apt-get) – guiverc Oct 04 '19 at 03:19

1 Answers1

2

Try man apt-get to see what's available.

man will show you the manual reference page for the command that follows it, and what options are available for that command for your release.

It'll tell you

   -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 an unauthenticated package or removing an essential package occurs
       then apt-get will abort. Configuration Item: APT::Get::Assume-Yes.

(as this was done a 19.10 box; your page may be different, but will perfectly match your release of Ubuntu)

guiverc
  • 30,396