You are getting the immediate exit because aptitude
is reading the y/n/q
response from its input pipe, which has been emptied by xargs
.
There are two things to try - you can pre-answer the prompt with:
aptitude search ttf | awk '' | aptitude -y install
Or you can display the command which would be executed, then copy/paste the output (adding quotes if necessary, though I doubt they will be) with:
aptitude search ttf | awk '' | xargs echo aptitude install