Skip to content

Auto Update Raspberry Pi

trinib edited this page Nov 9, 2022 · 7 revisions

Create auto-update script for linux

Open new script file called update and copy&paste script[click here]

sudo nano update.sh

Set permission

sudo chmod 700 update.sh

Open cron file by entering in command line crontab -e, copy&paste job command line below at the bottom of cron file and save.

0 3 * * WED sudo ./update.sh 2>&1 >~/updatelog

Pi will now update every Wednesday at 3am. Or you can go to https://crontab.guru/ and set your own time schedule.

Adjust Pi's date/timezone enter in terminal:

sudo dpkg-reconfigure tzdata

or set manually

sudo date -s "25 DEC 2012 11:14:00"

Other methods

Use unattended-upgrades or cron and aptitude

https://help.ubuntu.com/community/AutomaticSecurityUpdates