Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

in order avoid typing out all of the apt-get commands when updating my computer i have made a simple alias command to do it. But i really want to be able to just type in my alias and let it do its thing and not have to wait to for the yes/no prompt to type in "y". is there a simple way to bypass this prompt or maybe add "yes" in the alias somewhere?

share|improve this question
up vote 36 down vote accepted

Sure, although I have never tried it as an alias but it should work:

sudo apt-get update && sudo apt-get -y upgrade
share|improve this answer
Thank you! that worked perfectly! – Ntc Apr 2 '12 at 5:49
@wojox , i m think wt apt-get -y update do ? why is -y is in update ? , -y in upgrade seems to be ok , but -y in update !!!!! ? – One Zero Apr 2 '12 at 14:56
I will edit and remove the -y from update if it bothers you One Zero. :) – wojox Apr 2 '12 at 16:04
apt-get -o Dpkg::Options::='--force-confold' --force-yes -fuy dist-upgrade"
share|improve this answer
Could you be more specific? What does this command do and how does it work? – Seth Dec 10 '13 at 6:09

apt-get update && apt-get upgrade -y && apt-get autoremove && apt-get autoclean

This updates the packages, upgrades the packages, removes unused packages, then removes old versions of packages.

You can copy paste that into

nano -w


chmod 777



So long as you use su before all those steps, which I always do.

share|improve this answer
This answer goes... too far. He might not want to delete old/unused packages. Also I don't think you should ever use chmod 777 if it can be avoided. And I believe in Ubuntu the recommended way is to use apt-get rather than apt. – Andreas Hartmann Apr 1 '15 at 6:32

You could also do it quietly and then get a notification when it's all done. The downside to this is you will only see errors reported and will not see what is updated.

sudo apt-get update -qq && sudo apt-get dist-upgrade -qq && echo "All up to date now!" && notify-send "All up to date now!"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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