say yes to everything
October 23rd, 2006 mysurface Posted in Admin, alias, Misc, yes, yum | Hits: 16495 | 3 Comments »
Sometimes some commands always like to ask you for comfirmation. Are you sure … (Y/n). Sometimes, that is irritating, especially when you do yum update.
yum is package manager for Red Hat based linux, it usually takes a long time to get ready to download the update packages. Once yum is ready, it will ask you for confirmation, it usually ask “Are you sure you want to update ? ( Y/n ).”
I usually do
yum update
and walk away, I expect it to update everything, when I come back. But when I came, I realized that it doesn’t actually update, instead it ask you for confirmation.
To say yes for everything, you can uses command yes. Therefore, it solves the problem describe above.
yes | yum update
Command yes will keep replies y and enter until the execution is ended.
But I always forgot to add yes infront of yum. I have a trick, create an alias. Add the line bellow to your ~/.bashrc
alias yum="yes | yum"
When you type yum, it will automatically replace by yes | yum.







October 26th, 2006 at 12:01 am
cool, easier than writing an expect script.
May 2nd, 2007 at 10:46 am
In the case of Yum, you can use the -y option to skip all the questions as though you’ve typed “yes” to everything:
yum update -y
Or as an alias:
alias yum=’yum -y ‘
May 2nd, 2007 at 5:24 pm
You are right, yum -y works as expected. Thanks.