What does the flag do -yat startup apt-get install?
-y
apt-get install
Example, from https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions :
sudo apt-get install -y nodejs
Skip installation confirmation when you install something, ubuntu always asks for confirmation (Y / N), with -y Ubuntu skips this part.