Sometimes some commands always like to ask you for comfirmation. Are you sure … (Y/n). Sometimes, that is irritating, especially when you do
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
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
yes will keep replies
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.