This is a little helper script that runs all the update commands of the Raspberry Pi in an order. Making it more comfortable to use and also possible to tie to a cronjob for automatic system update schedules.

Lets start with creating the script file in our home dir:

$ sudo nano /home/pi/

Paste the following script into the file:

echo "-> sudo apt-get update"
sudo apt-get update
echo "-> sudo apt-get -y upgrade"
sudo apt-get -y upgrade
echo "-> sudo apt-get -y dist-upgrade"
sudo apt-get -y dist-upgrade
echo "-> sudo apt-get -y autoremove"
sudo apt-get -y autoremove
echo "-> sudo apt-get clean"
sudo apt-get clean

Save and close with CTRL + X and y.

Now make the script exetuable:

$ sudo chmod +x /home/pi/ 

Now you can run it by:

$ sudo /home/pi/

Create a scheduled update service

Go to your crontab to create a cron job:

$ sudo crontab -e

Go to the last line of the file and add at the very bottom:

0 3 * * * /home/pi/

This will run our update script every day at 3am.

Save and close with CTRL + X and y.

For your own timings and schedules I recommend using
Thats it with this little helper script!