In centos how do you answer yes automatically for yum install so that it is an unassisted install?

2 Answers 2


You can use:

yum -y install packagename

The "-y" implies "yes".

  • 28
    Or, if you don't like memorizing the right way to get "yes" into every program, just use yes | yum .... Oct 25, 2012 at 5:23
  • 4
    @DavidSchwartz i had no idea what yes was for until just now. amazing! Feb 12, 2016 at 2:29
  • How to provide "No" ? Jun 24, 2021 at 6:48
  • 1
    @ChamindaBandara yes no Nov 1, 2021 at 15:17

Add the following line to /etc/yum.conf


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.