Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

4 Answers 4

up vote 23 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
5  
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 yourscript.sh

then

chmod 777 yourscript.sh

then

./yourscript.sh

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 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

 
discard

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.