A abordagem mais simples é usar yes :
NAME
yes - output a string repeatedly until killed
SYNOPSIS
yes [STRING]...
yes OPTION
DESCRIPTION
Repeatedly output a line with all specified STRING(s), or 'y'.
Na maioria dos casos, é suficiente executar yes | command , em que command é o que executa a instalação.