What's the difference between yum -y install and yum install in CentOS

14.8k views Asked by At

I've seen two ways to install packages,for example,squid on CentOS:

1.yum -y install squid

2.yum install squid

can anyone tell me what's the difference between them ? also, I'm using CentOS v.6.6

2

There are 2 answers

0
jmd_dk On BEST ANSWER

If you supply -y it automatically chooses "yes" for future questions, i.e. are you sure you want to install squid? [Y/n]?.

It is handy if the installation takes a long time and asks multiple questions, which happens when you install multiple programs at once. In that case, having to type enter every now and again for the process to continue can be annoying.

For a full list of yum options and their definitions take a look at the help message for yum:

yum -h
0
Vikas Sachdeva On

With -y option, yum will install specified package along with its dependent package without asking for confirmation.

Without -y option, yum will show information related to specified package and its dependent packages and will ask for confirmation to install.

-y option will be useful if package is going to be installed through some scripts.