Bypass the yes/no prompt in 'apt-get upgrade'

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

sudo apt-get update && sudo apt-get -y upgrade

apt-get -o Dpkg::Options::='--force-confold' --force-yes -fuy dist-upgrade"

To clarify Dpkg::Options::='--force-confold' from the man-page:

--force-confold: do not modify the current configuration file, the new version is installed with a .dpkg-dist suffix. With this option alone, even configuration files that you have not modified are left untouched. You need to combine it with --force-confdef to let dpkg overwrite configuration files that you have not modified.


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.